Skip to content

Responses' status codes are not exposed #22

Closed
uriagassi opened this Issue Jan 11, 2012 · 6 comments

2 participants

@uriagassi

It would be nice to be able to check for response code 201 rather than "ok"=true, and for response code 409 instead of "error"="conflict"

@soitgoes
Owner
@uriagassi
@soitgoes
Owner

Sorry wasn't in front of the computer. On the ViewResult theere is a property "Response" which contains the full .Net Response object. Also There is a "StatusCode" property on the ViewResult which you can get this information off of.

Currently on the GetDocument etc we simply return the JSON Document and throw an exception if that response is not a 200. It might be nice to refactor so that there is a class which has both the JsonDoc as well as the .Net Response object off of it, however that's more than I'd like to take on at the moment and it would be a large impact change to all existing applications.

Do you think this large of a change is warranted?

@uriagassi
@soitgoes
Owner

StatusCode is now part of CouchResponse which inherits from JObject. Let me know what you think. Implemented in this way it shouldn't break any existing code.

@soitgoes soitgoes closed this Jan 18, 2012
@uriagassi

looks great, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.