0
나는 REST 인터페이스를 구축했습니다. '400 Bad Request'에서 오류에 대한 특정 정보가있는 json 본문을 반환합니다.URLError가 json 본문을 반환하지 않습니다.
(Pdb) error.code
400
파이썬 올바르게 이러한 헤더
(Pdb) print(error.headers)
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Sat, 20 Aug 2016 13:01:05 GMT
Connection: close
Content-Length: 236
236 문자의 내용이 있습니다
와 URLError를 던져,하지만 난 몸을 읽을 수있는 방법을 찾을 수 없습니다.내가 몸을
을 읽을 수 파이썬에서 방법을 찾을 수 없습니다,
{
"error_code": "00000001",
"error_message": "The json data is not in the correct json format.\r\nThe json data is not in the correct json format.\r\n'Execution Start Time' must not be empty.\r\n'Execution End Time' must not be empty.\r\n"
}
그러나 DHC 크롬 플러그인을 사용하여 추가 정보를 볼 수 있습니다 여기에 몇 가지 내가 시도하고 무엇 이었습니까 반환되었습니다.
(Pdb) len(error.read())
0
error.read().decode('utf-8', 'ignore')
''
(Pdb) error.readline()
b''
우리가 더 많은 도움이 될 수 있도록 코드를 제공하십시오. – nir0s