简体   繁体   中英

DropBox file upload using core api https://api-content.dropbox.com/1/files/<root>/<path>

I am integrating dropbox in my app using OAuth 2.0 and now I want to upload a image using it's core api https://api-content.dropbox.com/1/files/ /

my problem is there is no parameter shown for file upload (where i can send NSData)

DropBox documentation link :- https://www.dropbox.com/developers/core/docs ( /files (POST) )

I don't want to upload file/image using DBRestClient because it requires two time of login one via webView (OAuth 2.0) and another one via it's internal framework and my app require OAuth 2.0 integration.

Look closer. The documentation says:

Request body: "The file contents to be uploaded. Since the entire POST body will be treated as the file, any parameters must be passed as part of the request URL. The request URL should be signed just as you would sign any other OAuth request URL."

So you need to upload the actual contents through the message body (where the POST data would go).

However, the documentation also recommends to use /files_put instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM