cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

POST fail, error #400, Bad HTTP “Content-Type” header

POST fail, error #400, Bad HTTP “Content-Type” header

ram s.3
New member | Level 1

when trying to upload a file into the app folder using POST I get "Bad HTTP “Content-Type” header" error, however when trying to download a file using GET it works, the following is my POST, needless to say that I've tried all possible "Content-Type" without any success:

what is it I am missing here?

Thank you all in advance!

Best,

Ram

 

7 Replies 7

Greg-DB
Dropbox Staff

In your screenshot, you're setting your Content-Type header to "text/json". The error message is indicating that only "application/octet-stream" or "text/plain; charset=dropbox-cors-hack" are accepted.

ram s.3
New member | Level 1

Thank you for your quick reply!

as I wrote in my msg, I've tried all possible "Content-Type" without any success including "application/octet-stream" or "text/plain; charset=dropbox-cors-hack"

Greg-DB
Dropbox Staff

Can you share screenshots for those attempts then?

ram s.3
New member | Level 1

sure, different REST client using Firefox:

 

></p>
<p> </p>
<p><img id=

Greg-DB
Dropbox Staff

The response includes the Content-Type header that the API received. In both of these additional cases, it seems "; charset=UTF-8" was appended to the Content-Type you specified, resulting in an invalid Content-Type. Firefox is known to do this.

I posted an answer here about Firefox's behavior, including some information on ways to do this properly:

https://stackoverflow.com/questions/33902289/using-dropbox-v2-api-from-browser

ram s.3
New member | Level 1

Thank you, since its 3AM here I'm off to sleep now so I'll dive into it tomorrow, many thanks for your support!!!

ram s.3
New member | Level 1

Dear Gregory,

I've used a standalone REST client instead of the browsers add ins and this works as it should, once again, thank you for your support!

 

Best,

R.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    ram s.3 New member | Level 1
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?