如何在Box API 2.0中以程序化文件上传形式发送表单数据

编程入门 行业动态 更新时间:2024-10-11 13:24:29
本文介绍了如何在Box API 2.0中以程序化文件上传形式发送表单数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

以下是api 2.0框内文件上传中POST数据形式的正确示例吗?该文档说,文件名表单字段是一个字符串,但是当使用python发送帖子数据时,您实际上需要发送帖子中的文件内容。那么,content-disposition:form-data行是否位于正确的命名 filename字段并包含文件内容的方式下面?

Is the following a correct example of the form POST data in a file upload in the box api 2.0? The documentation says that the 'filename' form field is a string but when sending the post data in, say, python, you need to actually send the file contents in the post. So, is the content-disposition: form-data line below the correct way to name the 'filename' field and include the file contents?

Content-type: multipart/form-data, boundary=AaB03x Content-length: 142 Authorization: BoxAuth api_key=MY_API_KEY&auth_token=MY_AUTH_TOKEN --AaB03x content-disposition: form-data; name="filename"; filename="test.txt" Content-type: text/plain testing box api 2.0 --AaB03x--

推荐答案

您提到了Python,尽管没有提到这是必需条件。 如果可以使用Ruby(另一种脚本语言),那么您将拥有一个非常不错的库来处理2.0版的Box API。

You mention Python, although you don't mention as being a requirement. If you can use Ruby (another scripting language) you have a very nice lib to deal with Box API at the 2.0 version.

该库名为 ruby​​-box ,在自述文件中,您可以找到如何使用它。

The lib is named ruby-box and in the readme you can find how to use it.

更多推荐

如何在Box API 2.0中以程序化文件上传形式发送表单数据

本文发布于:2023-10-12 05:06:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1483793.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表单   中以   文件上传   形式   数据

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!