Python做有道翻译的的时候报http.client.RemoteDisconnected: Remote end closed connection without response

一开始只是加了头部信息,然后运行就报错,


后来想着不是不没有加form信息,最后发现果然是这样,

form = {
    "i":"inout",
    "from":"AUTO",
    "to":"AUTO",
    "smartresult":"dict",
    "client":"fanyideskweb",
    "salt":"1530014068235",
    "sign":"0a13eff5c3c1891d1b4818163f96e120",
    "doctype":"json",
    "version":"2.1",
    "keyfrom":"fanyi.web",
    "action":"FY_BY_REALTIME",
    "typoResult":"false",
}

加上了之后就解决了


猜你喜欢

转载自blog.csdn.net/yehuaner33/article/details/80820280
今日推荐