如何使用 Teambox REST API 上传文件
下面我粘贴了 Teambox api
文档中的内容:
https://teambox.com/api/upload
uploads#create POST
/api/1/projects/:project_id/uploads
/api/1/uploads
创建新上传。请注意,您需要使用表单编码来发布上传才能正常工作。
Parameters you should pass
{
"page_id": 456,
"project_id": 123,
"name": "Name",
"asset": "<File Data>"
}
问题:
- 使用表单编码上传是什么意思?
- asset:
代表什么?
任何代码示例也很棒。谢谢
Below I am pasting content from Teambox api
documentation:
https://teambox.com/api/upload
uploads#create POST
/api/1/projects/:project_id/uploads
/api/1/uploads
Creates a new upload. Note that you will need to post an upload using form encoding for this to work.
Parameters you should pass
{
"page_id": 456,
"project_id": 123,
"name": "Name",
"asset": "<File Data>"
}
Questions:
- What do we mean by upload using form encoding?
- What does asset:
<File Data>
represent?
Any code example would be great too. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎您必须在通话中发布数据到 teambox。
POST 是 Web 表单将数据传递到服务器时常用的方法之一。
此“官方”链接告诉您什么是什么
首先描述的方式描述了将思想调用为 GET 请求。
您获得的最新表单采用 POST 调用的形式。
您可以通过多种方式构建POST 调用,具体取决于您的客户端应用使用的母语。
如果是基于 javascript 的 Web 应用程序,您可以使用驻留在浏览器上的 XHTTPRequest 对象。
如果您的应用程序在基于 Linux 的系统中运行,也许您可以使用允许您构建该调用的库,例如 cURL 库。
那么,您可以展示代码或更深入地描述吗?
很高兴了解您的环境和编程语言。
Seems that you have to post data to teambox in your call.
POST is one of the methods commonly used by web forms, when passing data to a server.
This "official" link tells what is what
First described manners describe a call thought as a GET request.
Latest form you get takes the shape of a POST call.
You can build a POST call in many ways, depending on the native language your client app uses.
If is a javascript based web app, you can use XHTTPRequest object which resides on browsers.
If your app runs in a Linux based system, maybe you can use libraries that allow you build-up that call, such cURL library.
So, can you show the code or get deeper in your description?
Would be nice to know your environment and programming language.