I'm sending URL to remote server using Guzzle 6. If I try to send same URL with Postman, I will receive back generated report...which means that URL and connection is fine. Every time I dd file_put_contents, I will receive false. If I put some random string instead for $response, everything works. Executing my code will give me 200 OK, but as said I will always receive false with dd.
$this->client = new Client();
$response = $this->client->post($url);
dd(file_put_contents($this->filename, $response));
$response
alone will not work as this is an object.You'll need to use
$response()->getBody()
to get the contents of the response.It may also be worth casting it as a string:
dd(file_put_contents($this->filename, (string)$response->getBody()));