Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT Browser - Setting Accept-Language header dont work propertly
SWT Browser - Setting Accept-Language header dont work propertly [message #1368788] Tue, 20 May 2014 09:20
Victor Rodriguez is currently offline Victor RodriguezFriend
Messages: 1
Registered: May 2014
Junior Member
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.
Previous Topic:Admins: Please Delete This Thread
Next Topic:Child Expand bar doesn't get resized when expanded
Goto Forum:
  


Current Time: Sat Dec 20 15:11:43 GMT 2014

Powered by FUDForum. Page generated in 0.02081 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software