I am currently building a PHP webservice client for a Java server application that exposes its functionality using REST services. One of the services requires a PUT method with a request body in JSON format. Unfortunately, Guzzle seems to generate the request header "Content-Length" twice, resulting in the server to respond with a "400 Bad Request".
The PHP code I use looks as follows:
$client = new Client();
$request = $client->put($this->getServiceUrl($uri),array(
"User-Agent" => "LMF Client Library (PHP)",
"Content-Type" => "application/json; rel=meta"
), $metadata_json);
$response = $request->send();
Using a HTTP Analyzer (HTTP Scoop), I see that the header "Content-Length" generated by Guzzle is "135,135" while it should have only one value.
Environment: MacOS X Lion, latest Guzzle