Question: There a search service (PHP) which sends search query via POST. I would like to use that search engine in my app. The PHP service does not have a public API.

Is there a way to enter search query and to fetch a POST request to see the name of parameters? I would use then later to send a POST requests from my app and to catch POST responses. 

This is an official search engine with governmental officials who do not reply to my requests to tell me the name of parameters. It's nothing illegal, app is free of charge, it's just that I can no longer wait for them as they will reply to me. 

PS. I have access to Ubuntu shell and its admin tools. 

**EDIT**

This is how the search form looks like in the source of the web page (seen via browser)

```
<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" >
</form>

```

**EDIT 2** 

Do not edit post as a guy suggested me the proper way to do this via linux command curl.

Answer: 
Have you tried viewing the source on the search form to get the POST parameters? i.e. the name of the input box

**Edit**
take for example the php form on tizag site

```
<html><body>
<h4>Tizag Art Supply Order Form</h4>
<form action="process.php" method="post"> 
<select name="item"> 
<option>Paint</option>
<option>Brushes</option>
<option>Erasers</option>
</select>
Quantity: <input name="quantity" type="text" /> 
<input type="submit" />
</form>
</body></html>

```

the parameters are the input names i.e. quality and item

**Java code** (was using this for appengine)

```
HttpURLConnection connection = null;
String line = null;
BufferedReader rd = null;
String urlParameters = "search=search&submit=Submit";
serverAddress = new URL("http://www.search.com/search.php");
// set up out communications stuff
connection = null;
connection = (HttpURLConnection) serverAddress.openConnection();
// connection.setRequestMethod("GET");
connection.setRequestMethod("POST");
connection.setRequestProperty("Referer", "");
connection.setRequestProperty("User-Agent", ""); 
connection.setRequestProperty("Content-Length", "" + Integer.toString(urlParameters.getBytes().length));
connection.setRequestProperty("Content-Language", "en-US");
connection.setUseCaches(false);
connection.setDoInput(true);
connection.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
connection.connect();
if (connection.getResponseCode() == 404) {
    throw new ErrorException();
}
ArrayList<String> ud = new ArrayList<String>();
rd = new BufferedReader(new InputStreamReader(connection.getInputStream()));
while ((line = rd.readLine()) != null) {
    ud.add(line); // add response to arraylist
}

```
Whilst this is certainly something you could do with [curl in PHP](http://php.net/manual/en/book.curl.php), you should consider the possible consequences of scraping a government site to collect and reuse it's data.

Of course, I don't know how you will use the data, the importance of the data, the frequency of the requests or if you'll be using proxies. So might be nothing to worry about.

You want to know that parameters returned by a third party search engine. So you'd use curl to POST to the SE in question. Then parse the returned page and extract the information you're after.

**Edit:** Ok, so you're a Java guy. If you'd be more comfortable using the shell, read a few of the examples of PHP's "[exec](http://uk3.php.net/exec)" command. There's also the similar "[system](http://uk3.php.net/manual/en/function.system.php)" and "[passthru](http://uk3.php.net/manual/en/function.passthru.php)" you might want to look at.