By the way sorry for my english. Im trying to load in swt the contains of a http request to our report server. I did some research and finally have something like this.
final String[] header = new String[] {
"Content-Type: application/x-www-form-urlencoded; charset=UTF-8",
"Cache-Control: no-cache",
"Accept: */*",
"Accept-Encoding: gzip,deflate,sdch",
"Accept-Language: es-ES,es;q=0.8",
"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3" };
String url = "<my_url>";
String filters = "pCentroCompra=1&pCampana=16";
Browser myBrowser = new Browser(main, SWT.NONE);
myBrowser.setUrl(url, filters, header);
Its working pretty good but in some computers just fails because Locale. If i put some kind of sniffer on my machine i can see which headers it sends:
Referer: <my_url>\r\n
Accept-Language: es\r\n
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8; .NET4.0C; InfoPath.2; .NET4.0E)\r\n
Content-Type: application/x-www-form-urlencoded; charset=UTF-8\r\n
Cache-Control: no-cache\r\n
Accept: */*\r\n
Accept-Encoding: gzip, deflate\r\n
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3\r\n
Host: axprerps\r\n
Content-Length: 8047\r\n
Connection: Keep-Alive\r\n
So header for Accept-Language is just being ignored. Is this a normal behavior?
Thks in advance for any tip.
Cheers.