-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide response headers to all API methods #469
base: master
Are you sure you want to change the base?
Provide response headers to all API methods #469
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR contains two related but different changesets:
- Allow specifying request headers for all API endpoints
- A proposed solution to expose response headers by standardizing the return type of all API endpoints
Can you split them into their own PR? It will be much easier to review and update.
For example, the request header changes are much simpler and may be merged faster, wheareas the response changes may have more discussions/questions.
Got it 👍 This pull request appears to be based on the commits from #467 but I'm not sure that's really needed. Anyway, I'll review that other one first then. |
ApiClientBase.GetResponseAsync()
to extract the response body and headers to an object of typeApiResponse<T>
whereT
is the response type.ApiClientBase.GetApiErrorExceptionAsync()
to extract header values on error and assign that toApiErrorException.Headers
(a new dictionary property).ViewsApiClient.GetAllViewsAsync()
to return an object of typeApiResponse<GetAllViewsResponse>
instead ofGetAllViewsResponse
as it was before. TheApiResponse
has aHeaders
dictionary property and will also contain any other data that we want to pass for all responses in the future.ViewsApiClient.GetAllViewsAsync()
will be applied to all other API client methods. This is a major breaking change because we are changing the return values of all methods.The intent is to release this as part of v2.0.0 in February 2023.