skip to Main Content

I am executing two commands as follows:

curl http://somehost:port/endpoin

this return me 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 downoad the file successfully.

Can someone help me understand the issue?

2

Answers


  1. Chosen as BEST ANSWER

    --spider argument specified that the request issued is of type HEAD and not GET or POST

    following command works just fine thanks to @xirehat

    wget -S http://somehost:port/endpoint
    

  2. When you run this command

    curl http://somehost:port/endpoin
    

    It sends request GET method.

    But another one use HEAD method. So that service may only allows GET method and deny others.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search