json - "status_code": 422, "error_code": "REQUEST_PARAM_PARSE", "detail": "'data' 参数必须是一个列表"
问题描述
我正在使用 HTTP 请求向导设置对 MonkeyLearn 的 POST 请求。此端点需要请求正文(或有效负载正文)中的 JSON。它必须是具有 data 属性的对象和要分类为值的文本列表。例如:
{
"data": [
"This is the best sentiment analysis tool ever!!!",
]
}
所以,在HTTP请求向导中,我在Parameters下设置了:Name:dataValue:“这是最好的情感分析工具evert!!!” 类型:GetorPost
但是,在预览响应中,我得到:
{
"status_code": 422,
"error_code": "REQUEST_PARAM_PARSE",
"detail": "The ‘data’ parameter must be a list"
}
我无法弄清楚端点期望什么列表?
解决方案
我不熟悉“HTTP 请求向导”,也找不到它。但是从您所写的内容可以清楚地看出,您发送的是一个字符串而不是字符串数组。你的价值应该是这样的:Value: [ "This is the best sentiment analysis tool evert!!!" ]
推荐阅读
- php - 只有“/”适用于 symfony 4.4 应用程序
- awk - 替换最后一个斜杠之前、引号之间和特定行上的文本
- python - 使用时间序列进行数据清洗
- node.js - 按下反应时接收角色
- c# - 使用 C# 和 fonet 库将带有 xml fo 的 xml 文件转换为 pdf
- javascript - 在使用自定义悬停图像效果时,当另一个 html 元素添加到 body 时,图片的方向会在悬停时发生变化
- sql - 如何使用带有动态参数的 ansible postgress 查询
- google-cloud-platform - 谷歌云负载均衡器 + GKE 入口
- java - java:重构编码密码
- azure - 带有外部身份验证服务的 Azure oauth