Skip to content
/ http Public

This PHP library provides a powerful and flexible way to send HTTP requests to any URL from within your Laravel applications.

License

Notifications You must be signed in to change notification settings

persgeek/http

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Http Request

This PHP library provides a powerful and flexible way to send HTTP requests to any URL from within your Laravel applications.

How to install

composer require persgeek/http

How to send request

Translator

$fields = ['password' => 'admin'];

$translator = new Translator($fields);

Convertor

$algos = ['password' => 'md5'];

$convertor = new Convertor($algos);

Request

$request = new Request();

$request->setTranslator($translator)
    ->setConvertor($convertor);

$request->setAddress('https://test.com/login')
    ->setMethod('POST');

$headers = [
    'Accept' => 'application/json'
];

$params = ['password' => '@password'];

$request->setHeaders($headers)
    ->setParams($params);

$response = $request->getResponse();

print_r($response);

How to get response status

$status = $response->getStatus();

How to get response data

$token = $response->getValue('token');

About

This PHP library provides a powerful and flexible way to send HTTP requests to any URL from within your Laravel applications.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages