I am executing two commands as follows:
curl http://somehost:port/endpoint
This returns me a successful response.
Whereas if I execute the same command with wget as follows:
wget --spider -S http://somehost:port/endpoint
this gives me a 405 "Method not allowed" error.
If I simply do wget http://somehost:port/endpoint
I can download the file successfully.
What is the issue causing the error?
When you run this command
curl http://somehost:port/endpoin
It sends the request using the GET method.
But another one uses the HEAD method. So that service may only allow the GET method and deny others.