[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem with url-retrieve-synchronously and HTTP header
From: |
Christian Henz |
Subject: |
Problem with url-retrieve-synchronously and HTTP header |
Date: |
Fri, 7 Feb 2014 00:23:25 +0100 (CET) |
In emacs 23.4.1, I'm trying to access a local web service (written in
Python/Flask), but "url-retrieve-synchronously" does not properly process the
HTTP header returned.
When I retrieve google.com (among other sites), it works as expected:
(switch-to-buffer (url-retrieve-synchronously "http://google.com"))
HTTP/1.1 200 OK
Date: Thu, 06 Feb 2014 22:15:10 GMT
[...]
When I retrieve my local URL, the header is not parsed/cleaned correctly:
(switch-to-buffer (url-retrieve-synchronously "http://127.0.0.1:5000"))
HTTP/1.0 200 OK
Content-Type: text/plain; charset=UTF-8^M
[...]
Only the first line was "cleaned" by converting "\r\n" -> "\n".
"url-http-end-of-headers" then consequently points to the "\n" after "OK".
When I dump the header using curl, it looks correct to me:
HTTP/1.0 200 OK\r\n
Content-Type: text/plain; charset=UTF-8\r\n
[...]
I also remember this working as expected on another machine with the same local
service, but emacs 22...
Does anyone know what the problem might be?
Cheers,
Christian
- Problem with url-retrieve-synchronously and HTTP header,
Christian Henz <=