http-headers

Avoiding image compression on some 3G networks

懵懂的女人 提交于 2019-12-06 11:48:26
I want to download an image from the 'net and set it as the users background. This works great over wi-fi, and some 3G networks, but others (T-Mobile UK, for sure) seem to compress the images before sending them. This effect is noticeable when using the browser, too - however, if you long press on an image and save it, when viewing in the gallery it is either not compressed at all, or substantially less so. I want to be able to do this in my own app. I assume it has something to do with the HTTP headers, but of the ones I've modified, none has made a difference. Can anyone help me out here?

Blank page in IE6

Deadly 提交于 2019-12-06 11:16:31
A site I am working on that is built using PHP is sometimes showing a completely blank page. There are no error messages on the client or on the server. The same page may display sometimes but not others. All pages are working fine in IE7, Firefox 3, Safari and Opera. All pages are XHTML with this meta element: <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> It appears that I have fixed the problem by adding this PHP code: header('Content-type: text/html; charset=utf-8'); I have read that this problem may be caused by XHTML, encoding, gzip compression, or

How to modify request headers in c#,ASP .NET

蓝咒 提交于 2019-12-06 10:49:02
I am working on a ASP .NET mVC project & i have to change HttpHeaders. see the foolowing code snippet: WebRequest req= HttpWebRequest.Create("myURL"); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); req.Headers.Add("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.15) Gecko/2009101601 Firefox/3.0.15 (.NET CLR 3.5.30729)"); req.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); req.Headers.Add("Accept-Language", "en-us,en;q=0.5"); this gives a exception i.e. This header must be modified using the appropriate

getting value of location header using python urllib2

戏子无情 提交于 2019-12-06 10:46:01
when I use urllib2,and list the headers,I cannot see the 'Location' header. In [19]:p = urllib2.urlopen('http://www.example.com') In [21]: p.headers.items() Out[21]: [('transfer-encoding', 'chunked'), ('vary', 'Accept-Encoding'), ('server', 'Apache/2.2.3 (CentOS)'), ('last-modified', 'Wed, 09 Feb 2011 17:13:15 GMT'), ('connection', 'close'), ('date', 'Fri, 25 May 2012 03:00:02 GMT'), ('content-type', 'text/html; charset=UTF-8')] If I use telnet and GET telnet www.example.com 80 Trying 192.0.43.10... Connected to www.example.com. Escape character is '^]'. GET / HTTP/1.0 Host:www.example.com

Redirect not working with Header(Location ) and session variable

不问归期 提交于 2019-12-06 10:41:41
1: i use register.php to sign up the clients, 2: the data collected from the form is send to 1.php, it is saved in database 3: after form data is saved in database, 1.php forwards selected form data (myValue) to register.php?myValue='abc' in 1.php, i am saving a session variable like this @session_start(); $_SESSION['color']='blue'; the code of register.php is if (isset($_SESSION['color'])) { header('Location: http://mydomain.com/thankyou.php'); } else { @session_start(); some other stuff that was initially use for signing up the clients my logic is to check for session variable and to

Separating HTTP Response Body from Header in C++

早过忘川 提交于 2019-12-06 09:35:27
问题 I'm currently writing my own C++ HTTP class for a certain project. And I'm trying to find a way to separate the response body from the header, because that's the only part I need to return. Here's a sample of the raw http headers if you're not familiar with it: HTTP/1.1 200 OK Server: nginx/0.7.65 Date: Wed, 29 Dec 2010 06:13:07 GMT Content-Type: text Connection: keep-alive Vary: Cookie Content-Length: 82 Below that is the HTML/Response body. What would be the best way to do this? I'm only

Why does HTTP headers doesn't get created when I use Server.Transfer()?

廉价感情. 提交于 2019-12-06 09:25:14
问题 I'm using an .aspx page to serve an image file from the file system according to the given parameters. Server.Transfer(imageFilePath); When this code runs, the image is served, but no Last-Modified HTTP Header is created. as opposed to that same file, being called directly from the URL on the same Server. Therefor the browser doesn't issue an If-Modified-Since and doesn't cache the response. Is there a way to make the server create the HTTP Headers like normally does with a direct request of

XMLHttpRequest progress tracking and Symfony (CORS)

为君一笑 提交于 2019-12-06 08:47:20
I'm making a website using the Symfony framework, on an ovh server. When an user changes page, I create a new XMLHttpRequest to avoid to reload all the page and improve user experience. Everything works well, but I want to add a loading bar while the next page is loading asynchronously. Unfortunately the lengthComputable parameter was false. To go through this issue, I've set the header on Symfony3 just before sending the response with theses lines : $length = strlen($event->getResponse()->getContent()); $event->getResponse()->headers->set('Content-Length', $length); $event->getResponse()-

setting headers and sending data with $http POST to pocket api returns CORS

∥☆過路亽.° 提交于 2019-12-06 08:33:28
问题 Unable to send a http post request to pocket api for obtaining the request token. I've got the consumer key already. The problem appears to be in setting the headers and sending the data in the request. The request when viewed in the browser displays none of the headers and the data. Configuring Request var req = { method:'POST', url:'https://getpocket.com/v3/oauth/request', headers: { 'Content-Type': "application/x-www-form-urlencoded; charset=UTF8", 'X-Accept':'application/x-www-form

File name corruption on file download (IE)

不想你离开。 提交于 2019-12-06 08:28:59
问题 I have implemented a simple file upload-download mechanism. When a user clicks a file name, the file is downloaded with these HTTP headers: HTTP/1.1 200 OK Date: Tue, 30 Sep 2008 14:00:39 GMT Server: Microsoft-IIS/6.0 Content-Disposition: attachment; filename=filename.doc; Content-Type: application/octet-stream Content-Length: 10754 I also support Japanese file names. In order to do that, I encode the file name with this java method: private String encodeFileName(String name) throws Exception