#development #http #laravel #php

When you use the Laravel HTTP client, you might have run into the issue that when something goes wrong, you don't get the full response body.

To get the full response body, you'll need to do something like this:

1use Illuminate\Support\Facades\Http;
2use Illuminate\Http\Client\RequestException;
4try {
5    $response = Http::post($url, $params)->throw();
6} catch(RequestException $e) {
7    dd($e->response->body());