2

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.

2
  • 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
    Commented Jan 7, 2019 at 18:21
  • 1
    @Johan please add it as an answer so I can accept. It works now :) Commented Jan 7, 2019 at 18:27

1 Answer 1

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

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .