How do I send parameters for a PUT request in Guzzle 5?
问题 I have this code for sending parameters for a POST request, which works: $client = new GuzzleHttp\Client(); $request = $client->createRequest('POST', 'http://example.com/test.php'); $body = $request->getBody(); $request->getBody()->replaceFields([ 'name' => 'Bob' ]); However, when I change POST to PUT, I get this error: Call to a member function replaceFields() on a non-object This is because getBody is returning null. Is it actually correct to send PUT parameters in the body? Or should I do