I want to record with gzzle sending xml file. I did not find an example.
What i have done so far:
$xml2=simplexml_load_string($xml) or die("Error: Cannot create object"); use GuzzleHttp\Client; use GuzzleHttp\Psr7\Request; $client = new Client(); // $request = new Request('POST', $uri, [ 'body'=>$xml]); $response = $client->send($request); // //$code = $response->getStatusCode(); // 200 //$reason = $response->getReasonPhrase(); // OK // echo $response->getBody();
No matter what I try, I return a -1 error, which means the xml is invalid. The XML I'm submitting is being tested online, although it is valid% 100
Please, help.
xml php guzzle guzzle6
user3485417
source share