cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you an educator? Well we want to hear from you, so check out some tools we think might help you out 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

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

Greg-DB
Dropboxer

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.

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

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"

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

Greg-DB
Dropboxer

Can you share screenshots for those attempts then?

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

ram s.3
New member | Level 1

sure, different REST client using Firefox:

 

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

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

Greg-DB
Dropboxer

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

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

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!!!

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

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.

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

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