1

I make a post request from url like this

curl -s -X  POST http://site.com -d "data:data"

The thing is that I want to set a timeout for the url I am sending the post request to.

I tried -m 5, but then it doesn't make the request at all.

  • Just to be sure: The way you format your command in the example suggests you have tried adding the -m 5 between -X and POST (-X -m 5 POST). It needs to be -X POST because POST is the argument to -X. Have you tried curl -s -m 5 -X POST http://site.com -d "data:data"? – Johan Jan 7 at 18:21
  • 1
    @Johan please add it as an answer so I can accept. It works now :) – Born vs. Me Jan 7 at 18:27
2

Haha, thanks :) (Wild guess comment to answer conversion below)

Just to be sure: The way you format your command in the example suggests you have tried adding the -m 5 between -X and POST (-X -m 5 POST). It needs to be -X POST because POST is the argument to -X. Have you tried curl -s -m 5 -X POST http://site.com -d "data:data"?

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.