Python做有道翻译的的时候报http.client.RemoteDisconnected: Remote end closed connection without response
程序员文章站
2023-12-24 21:53:21
...
一开始只是加了头部信息,然后运行就报错,
后来想着不是不没有加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",
}
加上了之后就解决了