Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Responses' status codes are not exposed #22

Closed
uriagassi opened this Issue · 6 comments

2 participants

Uri Agassi Martin Murphy
Uri Agassi

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"

Martin Murphy
Owner
Uri Agassi
Martin Murphy
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?

Uri Agassi
Martin Murphy
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.

Uri Agassi

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.