Using libcurl to upload files to DropBox

假装没事ソ 提交于 2019-12-21 03:58:13

问题


I'm trying to use the libcurl in a C/C++ application to post files to DropBox.

I would like to use the "/files (POST)" API as documented here...

https://www.dropbox.com/developers/reference/api#files-POST

I am having problems with properly authenticating (OAuth) this call. It is unclear to me how to properly create the authentication signature.

From some a sample I saw, it looked like they were reading in the whole file to create the HMAC-SHA1 encoding on. This seems problematic on large files.

Does anyone have experience or insight using this API or something similar?


回答1:


I have just use the libouth and libcurl to get information from sina weibo. here is my example for you refer. you can also refer the liboauth test programmer in the tests dir, oauthtest.c

    if (use_post)
    {
        req_url = oauth_sign_url2(test_call_uri, &postarg, OA_HMAC, NULL, c_key, c_secret, t_key, t_secret);
        reply = oauth_http_post(req_url,postarg);
    } 



回答2:


I suggest using BOOST ASIO . Makes uploading and downloading a breeze.



来源:https://stackoverflow.com/questions/8373520/using-libcurl-to-upload-files-to-dropbox

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!