My setup, I have a Win11 machine with WSL2 running docker, I have a container of my Laravel application that when making HTTP requests if the body is too big, it gives an error, but the error is generic, it doesn't say it's the size, see:
Laravel application error: cURL error 28: Operation timed out after 60001 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for "https://example.com"
.
So I made the request outside the application and the container, directly in WSL2 with Curl, command:
curl -v POST http://example.com -H "Content-Type: application/json" -d @test2.json
Command error on WSL2:
<h1>Bad request!</h1>
<p>
Your browser (or proxy) sent a request that
this server could not understand.
</p>
<p>
If you think this is a server error, please contact
the <a href="mailto:postmaster@localhost">webmaster</a>.
</p>
But I don't think it's the server/url/api, because if I make this request from anywhere else it works, for example through Postaman I sent a body 5 times bigger and it worked and if I run this same command in the terminal from Windows11 it works, same command and same body, but now running from outside WSL (windows cmd, same computer):
curl -v POST http://example.com -H "Content-Type: application/json" -d @test2.json
works successfully.
What could it be? I've been looking for a solution for over 20 hours.