1
votes

I am trying to use curl to send a POST request with json.

I use Live HTTP Headers and get the url to send the request to. However it comes back "request denied. you do not have permission to access this page?"

How do I find the correct url?

from Live Http headers, i can see the json data {"var1":"val1","var2":"val2",...}

so i use the following curl command:

curl -H "Accept: application/json" -H "Content-type: application/json" -o output.html -L "http://domain.com/theurl" -d '{"var1":"val1","var2":"val2",...}'

1
Do you have permissions?Ralf de Kleine

1 Answers

1
votes

There may be other parts of the request you observed using Live HTTP Headers that allowed your browser to access that URL, such as a cookie value that indicated your session information or user credentials. If Live HTTP Headers has the ability to view those headers and/or cookies, you could grab them and include them in your curl request using additional -H 'Header: value' arguments.

HTTP Authentication may also be used, in which case you should pass your username and password to curl with --user name:password.