云函数url后,我指定了headers的content-type为json,依旧查看日志为urlencode, "queryStringParameters": {},
"isBase64Encoded": false,
"body": "status=3&siteId=6&mode=getNeedToPick",只能通过body去获取我上传的参数,虽然在云函数内处理一下就可以了,但我想知道有没有想平时调用云函数那样的方式,能通过
请求入参: {
"args": {
"name": "forUserNotice",
"clientInfo": {
"PLATFORM": "h5",
"OS": "android",
"APPID": "UNI6584702",
"LOCALE": "zh-Hans",
"DEVICEID": "16339354490262399785",
"CLIENT_SDK_VERSION": "1.0.9"
},
这样的方式才是我希望从日志里面看到的。不知道是我写错了,还是说这个云函数url化后只能是urlencode的默认格式了。
var yiny=require('yiny.js');
var headers={'content-type': 'application/json'};
var dizhi='xxxxx';
r = http.post(dizhi, {
status: "3",
siteId: "6",
mode:"getNeedToPick"
},headers);
toastLog(r.body.string());

xiaocaiji
- 发布:2021-10-11 19:07
- 更新:2021-10-11 19:07
- 阅读:373
云函数url化,是否无论指定格式与否,都会默认成为 "content-type": "application/x-www-form-urlencoded"
分类:ASK社区
0 个回复