go-dropbox icon indicating copy to clipboard operation
go-dropbox copied to clipboard

Add HTTP result header to file result types

Open boki opened this issue 9 years ago • 4 comments

The HTTP headers include interesting entries like X-Dropbox-Request-Id and Dropbox-Api-Result for certain calls. This commit adds a Header field to the output structs.

boki avatar Jan 25 '16 01:01 boki

hmm maybe we should normalize those header fields into individual struct fields, seems a little less ideal to just pass the http headers as-is IMO

tj avatar Jan 25 '16 01:01 tj

I pondered that but Google's Drive API uses a similar approach for the headers (it includes the servers status code as well but with Dropbox this is not really necessary). A helper method to unmarshal the data from the Dropbox-Api-Result might be worth considering, though, as not every user might need that data.

boki avatar Jan 25 '16 01:01 boki

I think that would be pretty useful, haven't needed it myself but I like the idea of having access to the download metadata etc from Dropbox-Api-Result instead of just a header

tj avatar Jan 25 '16 02:01 tj

What about embedding the metadata struct into the regular output so we can unmarshal it for the user? I think that'd be a little better API-wise than having to manually unmarshal, then we can ditch exposing the Header

tj avatar Jan 31 '16 21:01 tj