Releases: sketch7/FluentlyHttpClient
1.4.0: feat(middleware): logging detailed + per request config (#11)
* feat(middleware): logging detailed + per request config * update comment * add more tests for merged logging options + minor refactoring when getting options * update changelogs
1.1.0: Feature/beyond 1.0 enhancements (#5)
Features
-
request builder: implement
WithItemwhich allows to set custom items that can be used to share data within the scope of request, response, and middleware. -
request builder: add
WithUserAgentextension. -
request builder: add validation for request when 'GET' and has body content, to not be allowed. As it will blow up the underlying HttpClient.
-
request: add
Formatterswhich can be useful for middleware. -
message state: extract interface
IFluentHttpMessageState, which bothFluentHttpRequestandFluentHttpResponseimplements.
This will allow sharing implementations for extensions methods acrossFluentHttpRequestandFluentHttpResponserelated toItems. -
header builder: extract interface
IFluentHttpHeaderBuilder, which bothFluentHttpClientBuilderandFluentHttpRequestBuilderimplements.
This will allow sharing implementations for extensions methods acrossFluentHttpClientBuilderandFluentHttpRequestBuilderrelated toHeaders. -
http client builder: formatter JSON is now configured with camelcase property names by default.
-
http client builder: now shares request builder headers extensions such as
WithUserAgentandWithBearerAuthentication. -
http client builder: implement
ConfigureDefaultswhich enables to configure defaults for newly created http clients. -
logger middleware: add extension method
UseLogging. -
consts: add constants for headers and auth schemes
HeaderTypesandAuthSchemeTypes
1.0.0
Features
-
http client factory:
Removenow disposesIFluentHttpClient. -
http client builder: implement
WithFormattersto be able to configure formatters. -
http client: implement
IDisposablein order to dispose underlyingHttpClient. -
request builder: implement
ReturnAsString,ReturnAsStreamandReturnAsByteArray. -
request:
MethodandUrihas now also setters. -
request: Add
Itemsin order to share state across requests/response. -
response:
StatusCodeandReasonPhrasehas now also setters. -
response:
Itemsnow are shared with request. -
response: Expose
ContentfromMessage. -
middleware: Now supports arguments via
UseMiddleware<T>(args). -
timer middleware: Now supports options, for configure
WarnThreshold. -
timer middleware: Add extension method
UseTimerfor convience.
Code Refactoring
-
http client builder: Rename
AddMiddlewaretoUseMiddleware. -
http client builder:
UseMiddleware<T>, is now constrained withIFluentHttpMiddleware. -
request: Rename
UrltoUri.
0.3.0
Features
-
http client factory: validate options on
Add, in order to have better errors. -
http client factory: add default options to reduce the amount of config required (when not specified).
-
http client factory:
Addnow returns newly createdFluentHttpClient. -
http client factory: implement
WithRequestBuilderDefaultsadditional hook in order customizeFluentHttpRequestBuilderon creation. -
http client factory: implement
WithMessageHandlerin order to replace the HTTP stack for the HTTP client. -
http client factory: implement
AddwithFluentHttpClientOptions. -
http client factory: extract interface
IFluentHttpClientFactoryfromFluentHttpClientFactory. -
http client builder: add new method
AddMiddleware(Type). -
http client builder: align naming with request builder.
-
request builder: implement
WithSuccessStatusto specify or not whether to throw or not when request is not successful. -
request builder: implement
WithCancellationTokento be able to cancel http request. -
request builder: Http method now defaults as
Get. -
http client: implement
PatchandDeletemethods. -
http client: extract interface
IFluentHttpClientfromFluentHttpClient.
BREAKING CHANGES
IFluentHttpResponsehas been removed and addedFluentHttpResponseinstead. In addition, most ofFluentHttpResponse<T>method has been changed withFluentHttpResponse.
Most of the changes should only effect the internals, apart from middlewares.- Now requests created by
FluentHttpRequestBuilderwon't throw unless specified when request is not succeeded. FluentHttpClientFactory.Addnow returns the newFluentHttpClientinstance instead ofFluentHttpClientFactory.FluentHttpClientBuildermethods naming alignmentSetBaseUrl=>WithBaseUrlSetTimeout=>WithTimeoutAddHeader=>WithHeaderAddHeaders=>WithHeadersAddHeaders=>WithHeaders
- Middleware related has been moved to
FluentlyHttpClient.Middlewarenamespace, this effects:LoggerHttpMiddlewareTimerHttpMiddlewareIFluentHttpMiddlewareIFluentHttpMiddlewareRunner
FluentHttpClientFactoryusages now is changed withIFluentHttpClientFactoryFluentHttpClientusages now is changed withIFluentHttpClient
0.2.1
Features
-
request builder: validate request on
Build, in order to have better errors. -
request builder: implement query string
WithQueryParams. -
request builder: implement headers
WithHeader,WithHeadersandWithBearerAuthentication. -
http client: implement
Sendmethod withFluentHttpRequest. -
http client builder: implement
AddHeaderswhich accepts a dictionary. -
http client builder:
AddHeadernow replaces, instead of throwing when already defined.