Forum Discussion

ram s.3's avatar
ram s.3
New member | Level 1
10 years ago

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

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

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    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's avatar
    ram s.3
    New member | Level 1
    10 years ago

    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's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    Can you share screenshots for those attempts then?

  • ram s.3's avatar
    ram s.3
    New member | Level 1
    10 years ago

    sure, different REST client using Firefox:

     

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

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    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's avatar
    ram s.3
    New member | Level 1
    10 years ago

    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's avatar
    ram s.3
    New member | Level 1
    10 years ago

    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.

About Dropbox API Support & Feedback

Node avatar for 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!