0

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?

delegate
  • 121
  • 3
  • 8
  • Try the solution from [this][1] one. [1]: http://stackoverflow.com/questions/4424425/cant-get-httpparams-working-with-postrequest – Remarkable Sep 01 '13 at 22:49
  • That's not it, this is: http://stackoverflow.com/a/14524307/552735 user-agent is the keyword :) – delegate Sep 01 '13 at 23:22

0 Answers0