Forum Discussion

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

inbound and outbound Content-Type values

Hi there.

I'm working in a fairly restrictive environment without the option to use a different one. Under API v1 this was not a problem, because it was far less strict and its outputs less opinionated. API v2 appears to hold itself to a higher standard of adherence to good HTTP metadata with regard to its content, which is great for more flexible and general ways to access it but terrible for me.

 

My technical restrictions revolve primarily around the Content-Type header, and I do not believe that the others are relevant to my issue. I am forcibly restricted to the following values, and any incoming data that does not use them is dropped before I ever see it:

text/plain; charset=utf-8

application/xhtml+xml;charset=utf-8

application/atom+xml;charset=utf-8

application/json;charset=utf-8

application/xml;charset=utf-8

application/llsd+xml;charset=utf-8

application/x-javascript;charset=utf-8

application/javascript;charset=utf-8

application/x-www-form-urlencoded;charset=utf-8

application/rss+xml;charset=utf-8

 

In light of this, I am of course unable to handle responses with the Content-Type "application/octet-stream", which appears to be the exclusive response type available from Content-download endpoints. I understand why this is advantageous for Dropbox since it is a great deal more friendly for serving large files, but I am dealing exclusively with raw UTF-8 JSON documents that are unlikely to ever be longer than 2048 bytes long (in fact, also an extremely generous estimate).

Is there any means that I've missed in the documentation to pass a requested content type to API v2, or cause it to serve a content type according to the file's metadata? My only alternative if not is to make use of an intermediate service for repacking my requests or stop using dropbox when API v1 is disabled, and I would really rather not.

2 Replies

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

    Thanks for writing this up. Unfortunately, API v2 doesn't offer a way to specifically request particular Content-Type like this. I'll send this along as a feature request, but I can't promise that it will be implemented. Apologies I don't have a better answer for you!

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

    It's a pity there's no existing method, but I'm very glad to hear you guys are so flexible about issues your users might come up with. Thanks for the quick response!

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!