mrvx's recent timeline updates
mrvx

mrvx

V2EX member #276099, joined on 2017-12-21 19:13:55 +08:00
mrvx's recent replies
问题解决。。按一楼大佬的办法重新用了 requests 发现新世界
阿里云的示例是用 urllib 写的。。真是绕了很大的弯子


# -*- coding: UTF-8 -*-
import requests
import json


host = ''
path = ''
url = host+path
appcode = ""
body = {
"inputs": [
{
"text": {
"dataType": 50,
"dataValue": "“像家一样”,这样的酒店宣传语估计要大打折扣了,理由就是——脏!日前,加拿大一项堪称最大规模的调查显示,包括速 8、喜来登以及假日酒店在内的 6 大连锁酒店用品,如床上用品、遥控器等都有细菌,威胁住客健康,希望连锁酒店给住客一个真正干净的“家”"
}
}
]
}
headers = {
'Authorization':'APPCODE ' +appcode,
'Content-Type':'application/json; charset=UTF-8'
}
r = requests.post(url, data=json.dumps(body), headers=headers)
text = json.loads(r.text)
print(type(text))
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5188 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 16ms · UTC 08:12 · PVG 16:12 · LAX 01:12 · JFK 04:12
♥ Do have faith in what you're doing.