PHP GuzzleHttp. How to make a post request with params?

前端 未结 4 459
盖世英雄少女心
盖世英雄少女心 2021-01-30 02:57

How to make a post request with GuzzleHttp( version 5.0 ).

I am trying to do the following:

$client = new \\GuzzleHttp\\Client();
$client->post(
    \         


        
4条回答
  •  无人及你
    2021-01-30 03:28

    $client = new \GuzzleHttp\Client();
    $request = $client->post('http://demo.website.com/api', [
        'body' => json_encode($dataArray)
    ]);
    $response = $request->getBody();
    

    Add

    openssl.cafile in php.ini file

提交回复
热议问题