Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php send http request

// Initialize Guzzle client
$client = new GuzzleHttpClient();

// Create a POST request
$response = $client->request(
    'POST',
    'http://example.org/',
    [
        'form_params' => [
            'key1' => 'value1',
            'key2' => 'value2'
        ]
    ]
);

// Parse the response object, e.g. read the headers, body, etc.
$headers = $response->getHeaders();
$body = $response->getBody();

// Output headers and body for debugging purposes
var_dump($headers, $body);
Comment

PREVIOUS NEXT
Code Example
Php :: laravel maximum execution time of 30 seconds exceeded 
Php :: update wordpress query 
Php :: export to excel in php 
Php :: php sort multidimensional array by key 
Php :: doctrine querybuilder select alias 
Php :: create email template php 
Php :: php clean user input 
Php :: php catch echo output 
Php :: on running php file showing code instead of view 
Php :: laravel echo html 
Php :: install laravel on windows 
Php :: destroy multiple sessions in laravel 
Php :: php add array to array 
Php :: laravel attach 
Php :: php artisan tinker encryption cmd 
Php :: random string value laravel 
Php :: php increment and decrement 
Php :: maatwebsite/excel package 5.2 laravel 
Php :: php move element to beginning of array 
Php :: mysqli exception handling 
Php :: laravel request unique 
Php :: php curl empty response 
Php :: how to insert data in table and fetch in wordpress 
Php :: get current locale laravel 
Php :: php print object 
Php :: symfony connect rabbitMQ 
Php :: laravel passport client 
Php :: IlluminateContractsContainerBindingResolutionException 
Php :: filter wordpress 
Php :: laravel model column default value 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =