How to solve the problem when laravel GuzzleHttp directly reports an error when the interface returns 404?

  1. use GuzzleHttp to send a post request, and the returned data is 404 , resulting in a link status of 404 ;
  2. .
  3. then laravel will report back in the form of an error. How to make him not report an error?
  4. Code:
  $response = $http->post($url, $http_param);

error report:

Client error: `POST http://******` resulted in a `404 Not Found` response: {"code":0,"desc":"","timestamp":"20180426114652","data":"eyJlcnJvckNvZGUiOjQwNCwiZXJyb3JNc2ciOiJOb3QgRm91bmQifQ==" (truncated...)
  1. Note that the error report is made by laravel . It is useless for me to use try () {} catch () {} , but it will be reported back in the form of laravel error report.
  2. I don"t want him to report an error, I just want to get the 404 data returned;
  3. how to solve it?
Mar.05,2021

you can use try () {} catch () {} 404 to catch errors with GuzzleHttp\ Exception\ RequestException , document

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3bd23-2c2cf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3bd23-2c2cf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?