Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

There is a search page in a form and it sends a search query via POST request. I want to fetch this request via curl command line tool to inspect a POST request.

The HTML form looks like this:

<form action="search.php" method="POST">
   <input type="text" name="search" size=20><br>
   SZ<input type="checkbox" checked name="sz">
   NZ<input type="checkbox" checked name="nz">
   <input type="submit" name="search_term" value="search" >

How should my curl command look like?

share|improve this question
Curl is an HTTP client - it makes requests (aka fetching resources). It can't intercept a POST from another client, like your browser, which is what it sounds like you want to do. Or did you mean you want to make this POST request with curl? – ckhan Apr 30 '12 at 4:01

1 Answer 1

up vote 2 down vote accepted

As an example, to send a search of "foo" with sz checked and nz unchecked:

curl -d "search_term=search&search=foo&sz=on&nz=off"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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