-
-
Notifications
You must be signed in to change notification settings - Fork 776
Closed
Description
Hi,
I am using Refit a lot, and noticed a pattern in my libraries which I dislike:
- Use Refit
- Notice that exceptions need to be handled somewhat differently than Refits generic mechanism (e.g. instead of throwing a generic ApiException throw an UnauthorizedAccessException if the StatusCode is a 401 or 403).
- Write a wrapper interface around refit to statisfy Add top-level API #2
While this is not a large amount of code, it is annoying to write.
Would it be possible to add some attributes to Refit which can be used to instpect a Response and transform it, if necessary?
e.g.
` [Post("/api/v1")]
[OnException(ExceptionHandlingMethod)]
Task CreateAsync([Header("Authorization")] string authorization, [Body] CreateModel);
`
codymullins, vbornand, cristiz1992, Ernie23, czeslav87 and 8 more
Metadata
Metadata
Assignees
Labels
No labels