PortableRest icon indicating copy to clipboard operation
PortableRest copied to clipboard

Changed GetRawResponseContent to return content if there is some rega…

Open westwok opened this issue 10 years ago • 4 comments

…rdless of HttpStatusCode

westwok avatar Jan 19 '16 22:01 westwok

Return more information to the developer when there's a JsonSerializationException. If it was a 404 you would not know otherwise.

westwok avatar Jan 27 '16 20:01 westwok

I have faced same issue but returning null should not be needed? (I know the tests are expecting null, but this can be changed to asserting string.IsNullOrEmpty() - this could however be a problem with compatibility)

sahb1239 avatar Feb 08 '16 16:02 sahb1239

I suppose returning null will maintain compatibility and, if there is no content, it will behave as it did before. Are there any alternatives that would not break compatibility?

westwok avatar Feb 09 '16 15:02 westwok

You are breaking compatibility under all circumstances by returning data where it before returned null. The pull request are also breaking compatibility for success status codes since now the libary returns null where it before returned a empty string.

I really don't think that the users of this libary is checking for null to determine if a request has failed before checking the statuscode.

So I really think you should be consistent and just returing the response and change the tests.

sahb1239 avatar Feb 10 '16 19:02 sahb1239