homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients alan, martin.panter
Date 2015年09月09日.04:30:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1441773037.87.0.458309232096.issue25037@psf.upfronthosting.co.za>
In-reply-to
Content
It looks like this is a fault in the server. It does not appear to support Connection: close over HTTP 1.1, which is what Python’s "urllib.request" module uses. I think you will either have to get the server fixed, or work around the problem by using the low level "http.client" module, where you can avoid sending a "Connection: close" header field.
However see also Issue 12849, where various other people (including myself at one stage) have found this "Connection: close" flag triggers various server problems.
HTTP responses from the server with and without the "close" flag:
## HTTP 1.1 without Connection: close → good chunked response ##
POST /dataminer/rest/public/api/markets/dayahead/lmp/daily HTTP/1.1
Host: dataminer.pjm.com
Content-Type: application/json
Content-Length: 80
{"startDate": "2015-07-01", "endDate": "2015-07-01", "pnodelist": [135389795]}
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-UA-Compatible: IE=edge
Cache-Control: no-cache
Expires: -1
X-Powered-By: ASP.NET
X-AspNet-Version: 4.0.30319
X-Request-UUID: 09513fea-ac35-41ea-bf1b-b69357f42594
Transfer-Encoding: chunked
Server: Microsoft-IIS/7.5
Date: 2015年9月09日 04:12:34 GMT
Pragma: no-cache
Content-Type: application/json
Transfer-Encoding: chunked
Set-Cookie: dataminer=1923355820.36895.0000; path=/
1a44
[
 {
 "publishDate": "2015-07-01T04:00:00Z",
[. . .]
## HTTP 1.1 with Connection: close → invalid chunked response ##
POST /dataminer/rest/public/api/markets/dayahead/lmp/daily HTTP/1.1
Host: dataminer.pjm.com
Connection: close
Content-Type: application/json
Content-Length: 80
{"startDate": "2015-07-01", "endDate": "2015-07-01", "pnodelist": [135389795]}
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-UA-Compatible: IE=edge
Cache-Control: no-cache
Connection: close
Expires: -1
X-Powered-By: ASP.NET
X-AspNet-Version: 4.0.30319
X-Request-UUID: 0b43546c-d484-47a1-aff3-384f62a94a5a
Transfer-Encoding: chunked
Server: Microsoft-IIS/7.5
Date: 2015年9月09日 04:13:00 GMT
Pragma: no-cache
Content-Type: application/json
Connection: close
[
 {
 "publishDate": "2015-07-01T04:00:00Z",
[. . .]
History
Date User Action Args
2015年09月09日 04:30:37martin.pantersetrecipients: + martin.panter, alan
2015年09月09日 04:30:37martin.pantersetmessageid: <1441773037.87.0.458309232096.issue25037@psf.upfronthosting.co.za>
2015年09月09日 04:30:37martin.panterlinkissue25037 messages
2015年09月09日 04:30:37martin.pantercreate

AltStyle によって変換されたページ (->オリジナル) /