usersubuser
usersubuser

Reputation: 117

http post request curl

I have this website where I make a http post request http://requestmaker.com/

My question is how can I make this request with curl or other similar command line apps? windows or linux doesnt matter.

My Request URL is something like this:

http://www.website.net/servers?server%5Bgame%5D=cstrike1&server%5Bdomain%5D=192.168.1.1&server%5Bport%5D=27000

Request Headers:

Content-Type: application/json
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Refer: http://www.website.net/servers/new

Upvotes: 0

Views: 170

Answers (1)

Hans Z.
Hans Z.

Reputation: 53888

That would be:

curl -H "Content-Type: application/json" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" -H "Accept-Language: en-US,en;q=0.5" -H "Accept-Encoding: gzip, deflate" -H "Refer: http://www.website.net/servers/new" "http://www.website.net/servers?server%5Bgame%5D=cstrike1&server%5Bdomain%5D=192.168.1.1&server%5Bport%5D=27000"

but I think you meant to set the Referer header instead of Refer and you should probably POST JSON data since the Content-Type is application/json.

Upvotes: 1

Related Questions