欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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

程序员文章站 2023-12-24 21:53:21
...

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

Python做有道翻译的的时候报http.client.RemoteDisconnected: Remote end closed connection without responsePython做有道翻译的的时候报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",
}

加上了之后就解决了


相关标签: python 有道翻译

上一篇:

下一篇: