Closed andrewcoll closed 9 years ago
Cool, first pull request! Two minor nits, if you don't mind:
Request.AddHeader(string, string)
instead of Request.Headers.Add(...)
? (eg, like https://github.com/awec/infinity.net/blob/master/Infinity/Clients/GitClient.cs#L748 )Thanks!
So... also... I'm relatively sure (but I can't trust my memory 100%) that in the 1.0 preview API that this behaved differently.
Do you think that we should add Accept: application/json
to all requests by default (unless they're overridden)? (Not saying that you necessarily need to do this work, I'm just curious if you have thoughts here).
I'd say it would do no harm to add it to all requests actually.
I had a quick look through the docs and this appears to be the only scenario that calls out that the presence of the header will affect what is actually returned, but as the majority of requests return JSON anyway I guess it should be there by default.
I'll can make the changes you mentioned in your first comment too.
I guess it should be there by default.
I think that the download scenarios switch on content-type (application/zip
is a requirement, I believe). I feel like I remember something else requiring application/octet-stream
but I may be misremembering at this point.
In any case, this is probably outside the scope of this PR.
Thanks!
Adding accept JSON headers to ensure
GetItem
andGetItems
returns metadata instead of file contents.