Skip to content

Add HTTP result header to file result types#14

Open
boki wants to merge 4 commits intotj:masterfrom
boki:feature/server-response
Open

Add HTTP result header to file result types#14
boki wants to merge 4 commits intotj:masterfrom
boki:feature/server-response

Conversation

@boki
Copy link
Contributor

@boki boki commented Jan 25, 2016

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.

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.
@tj
Copy link
Owner

tj commented Jan 25, 2016

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

@boki
Copy link
Contributor Author

boki commented Jan 25, 2016

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.

@tj
Copy link
Owner

tj commented Jan 25, 2016

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

The UnmarshalDropboxApiResult helper unmarshals the optional Dropbox-Api-Result
HTTP header in to the Metadata struct.
@tj
Copy link
Owner

tj commented Jan 31, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments