Using curl to test POST data

From Littledamien Wiki
Revision as of 12:14, 19 September 2012 by Video8 (talk | contribs) (Created page with "==Basic request passing variables as POST== Use <code>--data</code> or <code>-d</code> option to pass variables to the page. <syntaxhighlight lang="bash"> $ curl -d "user=mylo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Basic request passing variables as POST

Use --data or -d option to pass variables to the page.

$ curl -d "user=mylogin&pass=mypass&foo=bar&biz=bash" http://www.mydomain.com/mypage/

Request using basic authentication

Use --user or -u option.

$ curl -u mylogin:mypass -d "user=mylogin&pass=mypass&foo=bar&biz=bash" http://www.mydomain.com/mypage/

Request using Windows integrated authentication

Add --ntlm option.

$ curl -u mylogin:mypass --ntlm -d "user=mylogin&pass=mypass&foo=bar&biz=bash" http://www.mydomain.com/mypage/

Special characters in username or password

Escape special characters with back slash.

$ curl -u mylogin:myp\&ss --ntlm -d "user=mylogin&pass=mypass&foo=bar&biz=bash" http://www.mydomain.com/mypage/