|
|
|
|
|
by tracker1
3627 days ago
|
|
Which is irritating as all hell at times... the .Net http client does this, which makes snagging the actual response text and code difficult... Same wrt .Net for response codes, there's a lot of errors that can happen with the JSON deserializer for services, but it returns a 500 series error not a 400 series. I usually wrap the on error in the app file, and replace those responses for .Net projects. Worth noting, not sure if this is improved/fixed in .Net Core based services. As I mentioned in another thread, I'm in favor of the response always being an object at the top level, with a data property for any response data, and an error property for any errors, errors having a "message" property that is the error message string, and a "code" property that matches the numeric http response code. This also helps if your error classes have these codes in them, that way the http response code can be set based on the error, defaulting to 500. |
|