【发布时间】:2021-10-16 07:20:20
【问题描述】:
我在我的工作项中使用 OnProgress 回调,但是当我尝试使用 !ACESAPI:acesHttpOperation 发送标头时遇到以下困难。
- 根据https://forge.autodesk.com/blog/cannot-match-arguments-error-when-using-aceshttpoperation下面一行满足正则表达式。
[08/12/2021 22:59:57] !ACESAPI:acesHttpOperation(GetFormaletas,?pk=30204db6-fe6c-4368-99a0-972781eb66c9,Authorization:Api-Key UI3rAhEG.rP5qlYHuwmw9664udwB9cbKs2OXMpMhX,,file://30204db6-fe6c-4368-99a0-972781eb66c9formaletas.csv)
您可以在下面看到每个参数接收到的内容。
[08/12/2021 22:59:57] !!!!This is an API callback => "!ACESAPI:acesHttpOperation(GetFormaletas,?pk=30204db6-fe6c-4368-99a0-972781eb66c9,Authorization:Api-Key UI3rAhEG.rP5qlYHuwmw9664udwB9cbKs2OXMpMhX,,file://30204db6-fe6c-4368-99a0-972781eb66c9formaletas.csv)"
[08/12/2021 22:59:57] Start processing API request acesHttpOperation.
[08/12/2021 22:59:57] Arguments => name="GetFormaletas", suffix="?pk=30204db6-fe6c-4368-99a0-972781eb66c9", headers="Authorization:Api-Key UI3rAhEG.rP5qlYHuwmw9664udwB9cbKs2OXMpMhX", requestContent="", responseFile="file://30204db6-fe6c-4368-99a0-972781eb66c9formaletas.csv"
[08/12/2021 22:59:57] - Download variadic item from "http://e320ece2e3e5.ngrok.io/projects/get-formaletas-csv?pk=30204db6-fe6c-4368-99a0-972781eb66c9" to "T:\Aces\Jobs\8b53409106af4388855f42e3c4e80f1c\30204db6-fe6c-4368-99a0-972781eb66c9formaletas.csv".
但由于缺少授权标头,我得到了 403。
[08/12/2021 22:59:57] Error: API failed. Reason = Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by the 'Response' property of this exception for details.
[08/12/2021 22:59:57] Error: Response = StatusCode: 403, ReasonPhrase: 'Forbidden', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
在服务器中,当我打印请求标头时,也可以看到缺少标头
Received headers ==> {'Host': 'e320ece2e3e5.ngrok.io', 'X-Forwarded-For': '3.212.238.83', 'X-Forwarded-Proto': 'http', 'Accept-Encoding': 'gzip'}
Forbidden: /projects/get-formaletas-csv
HTTP GET /projects/get-formaletas-csv?pk=30204db6-fe6c-4368-99a0-972781eb66c9 403 [0.00, 127.0.0.1:54139]
在文档中我没有看到带有标题的示例,欢迎提供任何指导。我也想知道如何发送多个标头。
提前非常感谢!
【问题讨论】:
标签: autodesk-forge