1

我正在尝试通过 REST API 将文件附加到 Asana 中的任务,但出现超时错误。我相信错误来自体式方面,所以我有点卡住了......

我提出的请求具有以下格式

POST https://app.asana.com/api/1.0/tasks/<my task>/attachments HTTP/1.1
User-Agent: OutSystemsPlatform
Content-Type: multipart/form-data; boundary="<my boundary>"
Authorization: Bearer <my bearer>
Host: app.asana.com
Content-Length: 218

--<my boundary>
content-disposition:  multipart/form-data; name=file; filename=<my filename>;
content-type: image/jpeg
<file binary data>
--<my boundary>--

我得到的答复如下

HTTP/1.1 504 Gateway Time-out
Connection: keep-alive
Content-Length: 176
Content-Type: text/html
Date: Tue, 28 Apr 2015 11:36:03 GMT
Server: nginx

<html>
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>

在我看来,请求的格式很好,但它不起作用。

任何人都可以帮忙吗?

谢谢佩德罗·卡多索

4

1 回答 1

0

好问题!不幸的是,由于服务器上发生的数据解析过程中抛出的错误,多部分/表单数据上传很容易生成 5xx。

我们正在努力加强这一点,并在可能的情况下返回 4xx。

我怀疑您由于线路终止不当而收到此错误。

发出的请求应遵循 HTTP/1.1 规范,即行终止符的形式CRLF此处\r\n 概述,以便服务器可靠且正确地处理请求。

于 2015-05-01T19:14:26.397 回答