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"?

  • 1
    Thanks joHan Solo :) – Born vs. Me Jan 7 at 18:38

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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