python3通过pycharm编译器调用requests接口返回JSON格式Unexpected UTF-8 BOM (decode using utf-8-sig) 5
代码如下:classhttp:def__init__(self,url,data):self.url=urlself.data=datadefhttpPost(self)...
代码如下:
class http:
def __init__(self,url,data):
self.url = url
self.data = data
def httpPost(self):
req = requests.post(self.url,self.data)
return req.json()
访问时报错信息:
Traceback (most recent call last):
File "C:/Python34/YunYingPingTai/Channel/HttpRequest.py", line 26, in <module>
print(t.json())
File "C:\Python34\lib\site-packages\requests\models.py", line 892, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Python34\lib\json\__init__.py", line 314, in loads
raise ValueError("Unexpected UTF-8 BOM (decode using utf-8-sig)")
ValueError: Unexpected UTF-8 BOM (decode using utf-8-sig)
大佬们求帮帮忙啊啊啊啊啊啊啊 展开
class http:
def __init__(self,url,data):
self.url = url
self.data = data
def httpPost(self):
req = requests.post(self.url,self.data)
return req.json()
访问时报错信息:
Traceback (most recent call last):
File "C:/Python34/YunYingPingTai/Channel/HttpRequest.py", line 26, in <module>
print(t.json())
File "C:\Python34\lib\site-packages\requests\models.py", line 892, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Python34\lib\json\__init__.py", line 314, in loads
raise ValueError("Unexpected UTF-8 BOM (decode using utf-8-sig)")
ValueError: Unexpected UTF-8 BOM (decode using utf-8-sig)
大佬们求帮帮忙啊啊啊啊啊啊啊 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询