cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

How to parse /upload endpoint's response when using pipes in node

Explorer | Level 3

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

 

image.png

4 Replies 4
Highlighted

Re: How to parse /upload endpoint's response when using pipes in node

Dropboxer
Dropboxer
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.
Highlighted

Re: How to parse /upload endpoint's response when using pipes in node

Helpful | Level 6

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.

Highlighted

Re: How to parse /upload endpoint's response when using pipes in node

Explorer | Level 3

Thanks! I will dig into this

Highlighted

Re: How to parse /upload endpoint's response when using pipes in node

Explorer | Level 3

Thanks for the answer, if nothing helps I will resort to SO 

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?