Web-Anchor
Web-Anchor copied to clipboard
Sometimes I want an HttpResponse and sometimes a deserialized object
Sometimes I want an HttpResponse and sometimes a deserialized object, do I have to write another method signature then? I don't like it. What can we do?
I don't mind it myself, but it seems that it can cause problems. I've came across code bases where one would use Task<HttpResponseMessage> because they did not care about the response but still assumed that the success-check was made so potentially there would be failed requests that nobody was aware of. The "correct" way to handle this in WebAnchor is to just use Task as return type, which is described in the documentation, but might not be clear enough if you're just looking at the the exposed programming api...
I think we could type parameterize each and every signature, so you can, at runtime, specify what return type you want. What do you think?
Maybe it is already possible?