You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

MikkBenelis's avatar
MikkBenelis
Helpful | Level 5
6 months ago

400 status code for a regular GET request

Seems like I'm facing the same or really similar issue. Just wanted to try Dropbox for my pet-project read-only data storage and found that it always responds with a 400 status code for a regular GET request.

 

For testing purposes I created a text file with the "Hello world!" string and tried to get it using the shared link. It worked in browser without any issues. It worked in Postman and I found that the "Host" header is required. But it does not work with the HTTP request library I'm using in my project. I can't control its under-the-hood behavior and as a result getting constant 400 response.

 

Some details: I'm using an open-source Godot Engine with its high-level HTTPRequest class to send these requests. Not sure what library is behind this class, but most probably it is something that can be used by other companies as well...

  • Здравко's avatar
    Здравко
    Legendary | Level 20

    Hi MikkBenelis,

    To be sure what's going on you need to dump your request and see what's there. Otherwise it's just a speculation.

     


    MikkBenelis wrote:

    Seems like I'm facing the same or really similar issue. Just wanted to try Dropbox for my pet-project read-only data storage and found that it always responds with a 400 status code for a regular GET request.

    ...


    If you just get 400 status, your case is definitely not the same! In the current thread discussed issue is additional symbols added at the request end that result in second response - erroneous of course. The original request is executed correctly though. That's why the response is 200, not 400. If you don't know what's in your cases start investigate from zero. Just supposing is not best guide. 😉 In this thread the issue is Texas Instruments library bug that messes the request. If you don't use the same library, then your issue, despite looking similar, cannot be the same.

    Good luck.

     

    PS: Keep in mind that Dropbox strictly follows HTTP standard. So if in your code is a small "deviation", in spite may tolerated on some places, will be an issue on Dropbox.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    MikkBenelis As Здравко said, it doesn't sound like this is exactly the same as the original issue in the thread you posted in, so I've moved your message to its own thread.

     

    If you still need help with this, please share a sample of the full request and response, including both headers and bodies for both, so we can take a look. Please redact any secret values though.

    • MikkBenelis's avatar
      MikkBenelis
      Helpful | Level 5

      First of all, there is a chance that this problem is relevant to software I'm using, but when I tried Google Drive and a couple of other direct links for the same task it worked properly. It would be nice if you can help me capture the request details because I don't have low-level access to this library and since it is a TLS request, I can't capture it normally with Wireshark. I can send my minimal executable if it is acceptable, but I think it is better to point me to the way of TLS traffic capturing and decrypting.

       

      I'm sending a regular GET request with the manually added "Host" header with the value of "www.dropbox.com" just in case if it is not calculated automatically (I found that it is required in Postman). Below is the actual URL and all of the response details that I have.

       

      URL is: https://www.dropbox.com/scl/fi/fc5rwkff82yvy66ktagv7/test.txt?rlkey=wqzs2qbbfazbgj3ttcaik9pq2&dl=1

       

      Response code: 400


      Headers:
      - Content-Length: 1005
      - Content-Type: text/html
      - Vary: Accept-Encoding
      - X-Dropbox-Response-Origin: local
      - Date: Mon, 03 Jun 2024 16:39:53 GMT
      - Server: envoy
      - Connection: close

       

      Body:

       

      <!DOCTYPE html>
      <html>
      <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1" />
      <title>Dropbox - 400</title>
      <link href="https://cfl.dropboxstatic.com/static/metaserver/static/css/error.css" rel="stylesheet" type="text/css"/>
      <link rel="shortcut icon" href="https://cfl.dropboxstatic.com/static/images/favicon.ico"/>
      </head>
      <body>
      <div class="figure">
      <img src="https://assets.dropbox.com/www/en-us/illustrations/spot/target-miss.svg" alt="Error: 400"/>
      </div>
      <div id="errorbox">
      <h1>Error (400)</h1>Something went wrong. Don't worry, your files are still safe and the Dropbox team has been notified. Check out our <a href="https://status.dropbox.com">Status Page</a> to see if there is a known incident, our <a href="https://www.dropbox.com/help">Help Center</a> and <a href="https://forums.dropbox.com">forums</a> for help, or head back to <a href="https://www.dropbox.com/home">home</a>.
      </div>
      </body>
      </html>

       

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        A response like that should indicate that the request was malformed, so we'd want to see the raw HTTP request you're sending. Unfortunately we can't provide guidance on how to get that kind of logging from your client though, as the client itself isn't made by Dropbox. You may need to refer to the client's documentation or support resources.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,889 PostsLatest Activity: 6 days ago
327 Following

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