HTTP 400 Bad Request On Download
See original GitHub issueThe server now returns an HTTP 400 Bad Request on a files/download call to the API because of missing Content-Type.
In DropboxRequestHandler.cs, line 443, the Content type for RouteStyle.Download is set to null while the server needs at least a text/plain.
I simply removed the line setting the Content-Type null and it worked with the default Content-Type value. I guess the long term solution should be more in line with the API requirements.
`case RouteStyle.Download: request.Headers.Add(DropboxApiArgHeader, requestArg);
// This is required to force libcurl remove default content type header.
request.Content = new StringContent("");
//request.Content.Headers.ContentType = null;
completionOption = HttpCompletionOption.ResponseHeadersRead;
break;
`
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (5 by maintainers)
Top Results From Across the Web
How to Fix a 400 Bad Request Error (Causes and Fixes)
A 400 Bad Request error is a generic client error that occurs when the server determines that the error doesn't fall in any...
Read more >How to Fix a 400 Bad Request Error: 8 Easy Methods
Stuck with a 400 bad request error? Read this article to find out 8 simple methods to solve the problem and its possible...
Read more >HTTP Error 400 Bad Request: What It Is and How to Fix It
The HTTP error 400 Bad Request is a client-side error that can happen when you visit a website. Learn more about the common...
Read more >How to Fix the 400 Bad Request Error
The 400 Bad Request error means that the request you sent to the website server to view the page was somehow incorrect.
Read more >What is a Bad Request Error 400 and How Do You Fix It?
You can call it an error 400 message or 400: Bad Request. The error 400 also shows as “HTTP error 400” in some...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks! In addition, I think the problem originates from Xamarin using the “AndroidClientHandler” as HttpMessageHandler. So using the current lib version, a workaround would be explicitly setting the (less efficient) HttpClientHandler
dbx = new DropboxClient(accessToken, new DropboxClientConfig() { HttpClient = new HttpClient(new HttpClientHandler()) });
It appears that my previously posted workaround stopped working after migrating my project to a Android .NET6.
I now was able to implement an alternative workaround:
@greg-db would it be possible to fix this in the SDK as suggested here? I can also provide a demo project if that helps you reproducing the problem