Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
wheel
8 years agoExplorer | Level 4
Response headers
when i use dropbox api for uploading file. the http header contain chinese, for example:
"Dropbox-API-Arg:{\"path\": \"/Test/中文.doc\",\"mode\": \"add\",\"autorename\": true,\"mute\": false,\"stric...
Sekali
6 years agoExplorer | Level 4
here is request code:
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/octet-stream");
RequestBody body = RequestBody.create(mediaType, uploadfile);
Request request = new Request.Builder()
.url("https://content.dropboxapi.com/2/files/upload")
.method("POST", body)
.addHeader("Authorization", "Bearer "+token)
//"{\"path\": \"/w.pdf\",\"mode\": \"add\",\"autorename\": true,\"mute\": false,\"strict_conflict\": false}"
.addHeader("Dropbox-API-Arg", requestJson)
.addHeader("Content-Type", "application/octet-stream")
.build();
request json
{"autorename":true,"mode":"add","mute":false,"path":"/\\u6d4b\\u8bd5.pdf","strict_conflict":false}
when I request to upload file which named only contains English char ,it success. when it contains Chinese char ,it failed
Greg-DB
Dropbox Community Moderator
6 years agoSekali You didn't include how you're building your requestJson string, but the result doesn't look correct. You have "\\u" instead of "\u". Update your implementation to produce the correct JSON string. You can find more information in the documentation here.
- Sekali6 years agoExplorer | Level 4
Thanks , I sloved it. it's works , it's my fault. When I use Gson to convert object to JSON STRING ,it has a problem
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!