Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
danthedev
8 years agoExplorer | Level 3
How to parse /upload endpoint's response when using pipes in node
Hello
I am piping users request to /upload api endpoint. The file is saved properly, however I can't seem to handle server's response.
As you can see from the picture below, my (probably naive) approach ends up in unreadable sequence of characters. Am I missing something here?
Thanks
4 Replies
- Greg-DB8 years ago
Dropbox Community Moderator
We can't offer much help with Node itself or using pipes in Node in particular, but for reference, the Dropbox API /2/files/upload endpoint returns the uploaded file metadata as JSON in the HTTPS response body. Exactly what you do with that and how you handle it is up to you, so you may be better helped by asking for general Node help for handling data like this in a Node forum or on StackOverflow. - thelwang8 years agoHelpful | Level 7
maybe the reply from DropBox is gzip or deflate compressed? look for the "Content-Encoding" header in the REQUEST youre making. Though not really sure what is up with node pipes maybe its so low level you have to do your own http parsing or something. But in general read the request and response headers to help figure out whats going on.
if thats right then just stop the "Accept-Encoding" header from sending to dropbox when you make the request. You must be sending that already to get a compressed response. Avoiding sending thatll make the reply normal and not globelgook.
- danthedev8 years agoExplorer | Level 3
Thanks! I will dig into this
- danthedev8 years agoExplorer | Level 3
Thanks for the answer, if nothing helps I will resort to SO
About 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!