多部分表格-400不良要求

发布于 2025-01-26 10:49:13 字数 712 浏览 4 评论 0 原文

我想提出的API请求遇到了一些麻烦。这是我的帖子请求URL:

https> https ://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/fax

请求内容类型:Multipart form

neber neader name and value:

i.sstatic.net/kbg1i.png“ rel =“ nofollow noreferrer :

任何想法为什么会发生这种情况?谢谢大家!

I'm having some trouble with a an API request I'm trying to make. Here is my POST request URL:

https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/fax

Request content type: multipart form

Header name and value:

enter image description here

Review:

enter image description here

Any idea why this may be happening? Thank you all!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

飞烟轻若梦 2025-02-02 10:49:13

可以按照以下示例所示发送多部分/form-data:

POST / HTTP/1.1
HOST: platform.ringcentral.com/restapi/v1.0/account/~/extension/~/sms
Authorization: Bearer <MyToken>
Content-Type: multipart/form-data; boundary=12345

--12345
Content-Disposition: form-data; name="to"

+16505550101
--12345
Content-Disposition: form-data; name="to"

+16505550102
--12345
Content-Disposition: form-data; name="from"

+16505550100
--12345
Content-Disposition: form-data; name="text"

Hello World
--12345
Content-Disposition: form-data; name="attachment" filename="picture.jpg"

content of picture.jpg ...
--12345--

可以使用卷曲进行以下操作:

curl -XPOST https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/sms \
-H 'Authorization: Bearer <MyToken>' \
-F 'to=+16505550101' \
-F 'to=+16505550102' \
-F 'from=+16505550100' \
-F 'text=Hello World' \
-F '[email protected]'

参考

multipart/form-data can be sent as shown in the following example with image attachment:

POST / HTTP/1.1
HOST: platform.ringcentral.com/restapi/v1.0/account/~/extension/~/sms
Authorization: Bearer <MyToken>
Content-Type: multipart/form-data; boundary=12345

--12345
Content-Disposition: form-data; name="to"

+16505550101
--12345
Content-Disposition: form-data; name="to"

+16505550102
--12345
Content-Disposition: form-data; name="from"

+16505550100
--12345
Content-Disposition: form-data; name="text"

Hello World
--12345
Content-Disposition: form-data; name="attachment" filename="picture.jpg"

content of picture.jpg ...
--12345--

This can be done using curl as follows:

curl -XPOST https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/sms \
-H 'Authorization: Bearer <MyToken>' \
-F 'to=+16505550101' \
-F 'to=+16505550102' \
-F 'from=+16505550100' \
-F 'text=Hello World' \
-F '[email protected]'

References :

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文