How to get HTTP response code alongside the returned object #1644
Unanswered
maroonedsia
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, imagine I have this interface:
How can I retrieve the http status code alongside the returned object, particularly when something goes wrong? I don't want the raw response; I would like to receive something like:
Happy path: The actual list of students + 200
Unhappy path 1: null + 500
Unhappy path 2: null + 404
I own the Web APIs service that the Refit client is trying to reach. So, I could create an augmented response model, for example something like:
But, is there a built-in way to handle this gracefully by Refit? Thanks a lot! 👍
Beta Was this translation helpful? Give feedback.
All reactions