We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
VijayKumar E
3 years agoExplorer | Level 3
Bad HTTP "Content-Type" header from the Dropbox API
When I try a request to Dropbox API(v2), I am getting this error ,
"message": "Error in call to API function "users/get_current_account": Bad HTTP "Content-Type\" header: "application/x-www-fo...
Здравко
Legendary | Level 20
Hi VijayKumar E,
The error message is descriptive enough, I think. For most API calls data are transferred in JSON form, not in urlencoded one. Seems you are trying to pass something in incorrect form. Even more, neither '/users/get_space_usage' nor '/users/get_current_account' require any parameters, so what are you actually trying to pass?! 🤔 In both cases authentication information would be enough. It's not an API call parameter, but independent header entry!
Try to post some code snippet reproducing the issue or raw HTTP headers for more details.
PS: May be useful try Dropbox API Explorer for get_current_account (for example). Click 'Show Code' button and select 'HTTP request' to see what has to be. 😉
VijayKumar E
3 years agoExplorer | Level 3
Hi ,
For the mentioned APIs '/users/get_space_usage' and '/users/get_current_account' I am not sending any data in the request. So why should I set the content-type as application/json", "application/json; charset=utf-8", "text/plain; charset=dropbox-cors-hack" for the request ?
In both cases we are just passing the authentication information by referring DropBox Documentation .
By seeing the error message I tried the APIs by setting those content-type as application/json", "application/json; charset=utf-8", "text/plain; charset=dropbox-cors-hack" but still it was not working .
When I tried the API by passing the content-type as empty string ( Content-Type : “” ) it’s working fine.
- Здравко3 years agoLegendary | Level 20
VijayKumar E wrote:... So why should I set the content-type as application/json", "application/json; charset=utf-8", "text/plain; charset=dropbox-cors-hack" for the request ? ....
You shouldn't set anything, actually.
VijayKumar E wrote:...
When I tried the API by passing the content-type as empty string ( Content-Type : “” ) it’s working fine.Great! 👍 Seems you have found it. Maybe that's the way in your environment to disable content-type header sending together with empty query body. 🤷
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 12 months agoIf 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 or Facebook.
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!