Answers for "guzzle request functions"

PHP
6

guzzle post request with data

$response = $client->request('POST', 'http://httpbin.org/post', [
    'form_params' => [
        'field_name' => 'abc',
        'other_field' => '123',
        'nested_field' => [
            'nested' => 'hello'
        ]
    ]
]);
Posted by: Guest on November-09-2020
0

guzzle login example

$post_data = array(
  'title' => 'My work',
  'description' => 'This is a request created using curl',
  'submit' => 'submit',
);
$response = $http_client->post('/create.php', array(), $post_data)->send();
Posted by: Guest on January-01-2021

Browse Popular Code Answers by Language