Inconsistent RequestException message with and without trucateAt
Author: alecplCreated Aug 17, 2026Updated Sep 9, 2026
Laravel Version
12.66.0
PHP Version
8.2
Database Driver & Version
No response
Description
When using Illuminate\Http\Client\RequestException::dontTruncate() the exception message is:
HTTP request returned status code 405:
HTTP/1.1 405 Method Not Allowed
Server: nginx/1.20.1
Date: Wed, 12 Aug 2026 16:21:44 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 906242
<!DOCTYPE html>
<html lang="en">
<head>
...but when using Illuminate\Http\Client\RequestException::truncateAt(2048) the message does not include headers:
HTTP request returned status code 405:
<!DOCTYPE html>
<html lang="en">
<head>
...I'd like to see headers in both cases.
Steps To Reproduce
n/a
Source: laravel/framework