Our client wants to see some information in POST request headers we are sending, equivalent to what browsers send. Here's a server log for illustration:
[01/Sep/2013:23:11:57 +0100] "POST /script.php?par=test HTTP/1.1" 200 4 "-" "-"
And it should be like this:
[01/Sep/2013:23:11:57 +0100] "POST /script.php?par=test HTTP/1.1" 200 4 "appVer 1.0" "OS version 4.3"
I'm using HttpPost class and some script that wrapps SSL around HttpClient for HTTPS so I'd like to stay with current implementation. To add this info I tried
HttpPost post = new HttpPost(uri.toASCIIString());
post.setHeader("appVersion", appVer);
and
HttpParams httpParams = new BasicHttpParams();
httpParams.setParameter("appVersion", appVer);
HttpClient client = new DefaultHttpClient(httpParams);
without success. How do I do this?