Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

arthurhetem's avatar

Laravel Http Client headers

Hello, i need to remove the host and content-length headers from my http client request, but i can't, i've tried assigning empty string and setting as null but it keeps sending the headers.

0 likes
5 replies
arthurhetem's avatar

I'm trying to post info to a api on a service that i need to communicate with via rest, they have an WAF that apparently is blocking my request to get to their api, i'm in contact with them and they requested me to send the request without these headers

martinbean's avatar

@arthurhetem I doubt your request is being blocked due to the presence of ubiquitous headers such as Host and Content-Length. You’re most likely being blocked because your IP address has not been white-listed or similar.

Kajalishu's avatar

Yeah, you can use a Guzzle request middleware to manipulate the request before it is processed by Guzzle...

Please or to participate in this conversation.