Noliangperson 2022-07-15 17:25 采纳率: 50%
浏览 92
已结题

python 中post请求返回值是500

python 中 post请求 code 返回值是500

#url:https://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule
import requests

import json

url = 'https://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule%27
headers = {
"Content-Type":"application/json",
"Host": "fanyi.youdao.com",
"Origin": "https://fanyi.youdao.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36 Edg/103.0.1264.49"
}
data = {
'i': '你好中国',
'from': 'zh-CHS',
'to': 'en',
'smartresult': 'dict',
'client': 'fanyideskweb',
'salt': '16578734852847',

'lts': '1657873485284',
'bv': '99f65dce5b9aecb82d860e184d44cd9c',
'doctype': 'json',
'version': '2.1',
'keyfrom': 'fanyi.web',
'action': 'FY_BY_REALTlME'
}
res = requests.post(url=url,data=data,headers=headers)
code = res.status_code
print(code)
#print(res.json())
#if code== 200:

print(res.content)

500

我把translate_o换成translate
url = 'https://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule%27
还是不行,不知道问题出在哪里了

  • 写回答

2条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      问题事件

      • 系统已结题 7月23日
      • 已采纳回答 7月15日
      • 创建了问题 7月15日

      悬赏问题

      • ¥15 hdfs在idea上传文件运行错误
      • ¥15 关于selenium网页闪退
      • ¥15 怎么用PYTHON解类似于x = y+zx + cy = x+zy + v的方程
      • ¥300 FLASH AS2.0制作一个类似手机上下滑动一样的效果
      • ¥15 为什么使用openFoam 中的icoFoam计算圆柱扰流时出现浮点数例外(核心已转储)
      • ¥15 51单片机外部中断控制数码管
      • ¥15 创建网页里面的图片显示不出来
      • ¥15 语音控制的编写?(语言-c#)
      • ¥15 matlab输入书上的代码运行错误
      • ¥15 matlab怎么做三维曲面