首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Upload REST API显示400个错误请求

Upload REST API显示400个错误请求
EN

Stack Overflow用户
提问于 2020-07-10 21:38:25
回答 2查看 284关注 0票数 0

我有一个ESB网络服务客户端上传文件到阿卢斯科使用以下RestAPI。

http://:8080/alfresco/service/api/upload

我理解,API被调用为多部分/表单数据,带有文件和必填字段。当我执行的时候,我得到了下面的ersponse错误。

代码语言:javascript
复制
{
  "status": {
    "code": 400,
    "name": "Bad Request",
    "description": "Request sent by the client was syntactically incorrect."
  },
  "message": "Required parameters are missing",
  "exception": "",
  "callstack": [],
  "server": "Enterprise v5.2.3 (r852994b1-b12) schema 10,065",
  "time": "10-Jul-2020 12:26:47"
}

我使用WSO2企业服务总线客户端,企业服务总线代码看起来都很好。我唯一可以调试的地方是通过wirelog。wirelog显示alll (请查看下面的屏幕截图)。错误消息包含冲突信息,如

"description":“客户端发送的请求语法错误。”"message":“缺少必需的参数”,

有没有一个日志,我可以从Alfresco服务器端获得,以确定到底是什么问题,哪种语法是不正确的?缺少什么参数?

网线日志屏幕截图如下

please click this link to see image of wiretap

EN

回答 2

Stack Overflow用户

发布于 2020-07-11 23:05:33

您遵循的是哪些文档?快速浏览一下这里,我会说您没有发送您应该发送的所有内容:https://docs.alfresco.com/5.0/references/RESTful-UploadUploadPost.html

这是你看到的被触发的情况,所以我会更仔细地查看你实际发送的内容。可以使用Fiddler或类似的软件来记录您的请求并检查它。

代码语言:javascript
复制
// Ensure mandatory file attributes have been located. Need either destination, or site + container or updateNodeRef
      if ((filename === null || content === null) || (destination === null && (siteId === null || containerId === null) && updateNodeRef === null))
      {
         exitUpload(400, "Required parameters are missing");
         return;
      }

此外,在这里可以找到有问题的web脚本,它是用JS实现的,因此添加额外的(临时)日志记录相对容易。

代码语言:javascript
复制
...alfresco\tomcat\webapps\alfresco\WEB-INF\lib\alfresco-remote-api-5.0.d.jar\alfresco\templates\webscripts\org\alfresco\repository\upload\
票数 0
EN

Stack Overflow用户

发布于 2020-07-12 13:36:19

您可以使用api-explorer rest api上传文档。

https://api-explorer.alfresco.com/api-explorer/#!/nodes/createNode

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62835526

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档