ArangoDB-Community / arangodb-net-standard

A consistent, comprehensive, minimal interface to enable .NET applications to use the complete range of features exposed by the ArangoDB REST API.
Apache License 2.0
76 stars 30 forks source link

Provide response headers to all API methods #469

Open tjoubert opened 1 year ago

tjoubert commented 1 year ago
  1. Added ApiClientBase.GetResponseAsync() to extract the response body and headers to an object of type ApiResponse<T> where T is the response type.
  2. Amended ApiClientBase.GetApiErrorExceptionAsync() to extract header values on error and assign that to ApiErrorException.Headers (a new dictionary property).
  3. As an example, I changed ViewsApiClient.GetAllViewsAsync() to return an object of type ApiResponse<GetAllViewsResponse> instead of GetAllViewsResponse as it was before. The ApiResponse has a Headers dictionary property and will also contain any other data that we want to pass for all responses in the future.
  4. Based on our discussions on this PR, the changes in 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.
tjoubert commented 1 year ago

@DiscoPYF , this PR is the response-related aspect of the feature only. Please the PR for request-related stuff first: https://github.com/ArangoDB-Community/arangodb-net-standard/pull/467

DiscoPYF commented 1 year ago

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.