NamespaceSystemLibrary.Common.Framework.App
Client is a class for all http(s) requests in your project
Uses HttpClient and Polly behind the scenes for features such as reusing tcp connections, retry on 502 and 504 status codes, and optionally a request breaker for 7 seconds, if 25 error codes (404, 429, 500, 502, 503, 504, 505) occurs in a row
useRetryPolicy: false, will retry once if request is a file request or GET or POST and status code is 502 or 504Options:
useRetryPolicy:True: same as 'false', but adds:
- retries one additional time on 502, 504 GET, POST- retries up to two times if response is null (timeout/no response)
- retries once on 401 GET, POST- retries once on 404 GET
- retries once on 500 GET, POST- retries once on 404, 500, 502 504 file request
- retries once on OPTION, PATCH, HEAD, CONNECT, TRACERemarks
Every client uses the Default configurations, which you can override in appsettings.json
Most default configurations can again be overriden in the Clients constructor
Each HttpClient pool behind the scenes, is based on scheme, url, port and timeoutEach method also take an additional timeout parameter, a different timeout will target a different HttpClient
Each underlying HttpClient is used for default 20 minutes, each TCP connection is maximum reused for 4 minutes and 55 secondsA 502 or 504 response on GET, POST or file request will always be retried once, cannot be turned off unless RetryTimeout is set to 0 in appSettings
A new client wont neccesary create a new HttpClient, it might use from cache, it all depends on the url and params you pass in- In theory you could create just one client reusing towards any url you want
- But it's now up to you now: You want a new instance? Injection? Create your own static wrapper? Sure!Client
public class Client
Inheritance
Constructors
Remarks
Every client uses the Default configurations, which you can override in appsettings.json
Most default configurations can again be overriden in the Clients constructor
Each HttpClient pool behind the scenes, is based on scheme, url, port and timeoutEach method also take an additional timeout parameter, a different timeout will target a different HttpClient
Each underlying HttpClient is used for default 20 minutes, each TCP connection is maximum reused for 4 minutes and 55 secondsA 502 or 504 response on GET, POST or file request will always be retried once, cannot be turned off unless RetryTimeout is set to 0 in appSettings
A new client wont neccesary create a new HttpClient, it might use from cache, it all depends on the url and params you pass in- In theory you could create just one client reusing towards any url you want
- But it's now up to you now: You want a new instance? Injection? Create your own static wrapper? Sure!Methods
Remarks
Every client uses the Default configurations, which you can override in appsettings.json
Most default configurations can again be overriden in the Clients constructor
Each HttpClient pool behind the scenes, is based on scheme, url, port and timeoutEach method also take an additional timeout parameter, a different timeout will target a different HttpClient
Each underlying HttpClient is used for default 20 minutes, each TCP connection is maximum reused for 4 minutes and 55 secondsA 502 or 504 response on GET, POST or file request will always be retried once, cannot be turned off unless RetryTimeout is set to 0 in appSettings
A new client wont neccesary create a new HttpClient, it might use from cache, it all depends on the url and params you pass in- In theory you could create just one client reusing towards any url you want
- But it's now up to you now: You want a new instance? Injection? Create your own static wrapper? Sure!Remarks
Every client uses the Default configurations, which you can override in appsettings.json
Most default configurations can again be overriden in the Clients constructor
Each HttpClient pool behind the scenes, is based on scheme, url, port and timeoutEach method also take an additional timeout parameter, a different timeout will target a different HttpClient
Each underlying HttpClient is used for default 20 minutes, each TCP connection is maximum reused for 4 minutes and 55 secondsA 502 or 504 response on GET, POST or file request will always be retried once, cannot be turned off unless RetryTimeout is set to 0 in appSettings
A new client wont neccesary create a new HttpClient, it might use from cache, it all depends on the url and params you pass in- In theory you could create just one client reusing towards any url you want
- But it's now up to you now: You want a new instance? Injection? Create your own static wrapper? Sure!Remarks
Every client uses the Default configurations, which you can override in appsettings.json
Most default configurations can again be overriden in the Clients constructor
Each HttpClient pool behind the scenes, is based on scheme, url, port and timeoutEach method also take an additional timeout parameter, a different timeout will target a different HttpClient
Each underlying HttpClient is used for default 20 minutes, each TCP connection is maximum reused for 4 minutes and 55 secondsA 502 or 504 response on GET, POST or file request will always be retried once, cannot be turned off unless RetryTimeout is set to 0 in appSettings
A new client wont neccesary create a new HttpClient, it might use from cache, it all depends on the url and params you pass in- In theory you could create just one client reusing towards any url you want
- But it's now up to you now: You want a new instance? Injection? Create your own static wrapper? Sure!Remarks
Every client uses the Default configurations, which you can override in appsettings.json
Most default configurations can again be overriden in the Clients constructor
Each HttpClient pool behind the scenes, is based on scheme, url, port and timeoutEach method also take an additional timeout parameter, a different timeout will target a different HttpClient
Each underlying HttpClient is used for default 20 minutes, each TCP connection is maximum reused for 4 minutes and 55 secondsA 502 or 504 response on GET, POST or file request will always be retried once, cannot be turned off unless RetryTimeout is set to 0 in appSettings
A new client wont neccesary create a new HttpClient, it might use from cache, it all depends on the url and params you pass in- In theory you could create just one client reusing towards any url you want
- But it's now up to you now: You want a new instance? Injection? Create your own static wrapper? Sure!Remarks
Every client uses the Default configurations, which you can override in appsettings.json
Most default configurations can again be overriden in the Clients constructor
Each HttpClient pool behind the scenes, is based on scheme, url, port and timeoutEach method also take an additional timeout parameter, a different timeout will target a different HttpClient
Each underlying HttpClient is used for default 20 minutes, each TCP connection is maximum reused for 4 minutes and 55 secondsA 502 or 504 response on GET, POST or file request will always be retried once, cannot be turned off unless RetryTimeout is set to 0 in appSettings
A new client wont neccesary create a new HttpClient, it might use from cache, it all depends on the url and params you pass in- In theory you could create just one client reusing towards any url you want
- But it's now up to you now: You want a new instance? Injection? Create your own static wrapper? Sure!Remarks
Every client uses the Default configurations, which you can override in appsettings.json
Most default configurations can again be overriden in the Clients constructor
Each HttpClient pool behind the scenes, is based on scheme, url, port and timeoutEach method also take an additional timeout parameter, a different timeout will target a different HttpClient
Each underlying HttpClient is used for default 20 minutes, each TCP connection is maximum reused for 4 minutes and 55 secondsA 502 or 504 response on GET, POST or file request will always be retried once, cannot be turned off unless RetryTimeout is set to 0 in appSettings
A new client wont neccesary create a new HttpClient, it might use from cache, it all depends on the url and params you pass in- In theory you could create just one client reusing towards any url you want
- But it's now up to you now: You want a new instance? Injection? Create your own static wrapper? Sure!Remarks
Every client uses the Default configurations, which you can override in appsettings.json
Most default configurations can again be overriden in the Clients constructor
Each HttpClient pool behind the scenes, is based on scheme, url, port and timeoutEach method also take an additional timeout parameter, a different timeout will target a different HttpClient
Each underlying HttpClient is used for default 20 minutes, each TCP connection is maximum reused for 4 minutes and 55 secondsA 502 or 504 response on GET, POST or file request will always be retried once, cannot be turned off unless RetryTimeout is set to 0 in appSettings
A new client wont neccesary create a new HttpClient, it might use from cache, it all depends on the url and params you pass in- In theory you could create just one client reusing towards any url you want
- But it's now up to you now: You want a new instance? Injection? Create your own static wrapper? Sure!Remarks
Every client uses the Default configurations, which you can override in appsettings.json
Most default configurations can again be overriden in the Clients constructor
Each HttpClient pool behind the scenes, is based on scheme, url, port and timeoutEach method also take an additional timeout parameter, a different timeout will target a different HttpClient
Each underlying HttpClient is used for default 20 minutes, each TCP connection is maximum reused for 4 minutes and 55 secondsA 502 or 504 response on GET, POST or file request will always be retried once, cannot be turned off unless RetryTimeout is set to 0 in appSettings
A new client wont neccesary create a new HttpClient, it might use from cache, it all depends on the url and params you pass in- In theory you could create just one client reusing towards any url you want
- But it's now up to you now: You want a new instance? Injection? Create your own static wrapper? Sure!Remarks
Every client uses the Default configurations, which you can override in appsettings.json
Most default configurations can again be overriden in the Clients constructor
Each HttpClient pool behind the scenes, is based on scheme, url, port and timeoutEach method also take an additional timeout parameter, a different timeout will target a different HttpClient
Each underlying HttpClient is used for default 20 minutes, each TCP connection is maximum reused for 4 minutes and 55 secondsA 502 or 504 response on GET, POST or file request will always be retried once, cannot be turned off unless RetryTimeout is set to 0 in appSettings
A new client wont neccesary create a new HttpClient, it might use from cache, it all depends on the url and params you pass in- In theory you could create just one client reusing towards any url you want
- But it's now up to you now: You want a new instance? Injection? Create your own static wrapper? Sure!Remarks
Every client uses the Default configurations, which you can override in appsettings.json
Most default configurations can again be overriden in the Clients constructor
Each HttpClient pool behind the scenes, is based on scheme, url, port and timeoutEach method also take an additional timeout parameter, a different timeout will target a different HttpClient
Each underlying HttpClient is used for default 20 minutes, each TCP connection is maximum reused for 4 minutes and 55 secondsA 502 or 504 response on GET, POST or file request will always be retried once, cannot be turned off unless RetryTimeout is set to 0 in appSettings
A new client wont neccesary create a new HttpClient, it might use from cache, it all depends on the url and params you pass in- In theory you could create just one client reusing towards any url you want
- But it's now up to you now: You want a new instance? Injection? Create your own static wrapper? Sure!Remarks
Every client uses the Default configurations, which you can override in appsettings.json
Most default configurations can again be overriden in the Clients constructor
Each HttpClient pool behind the scenes, is based on scheme, url, port and timeoutEach method also take an additional timeout parameter, a different timeout will target a different HttpClient
Each underlying HttpClient is used for default 20 minutes, each TCP connection is maximum reused for 4 minutes and 55 secondsA 502 or 504 response on GET, POST or file request will always be retried once, cannot be turned off unless RetryTimeout is set to 0 in appSettings
A new client wont neccesary create a new HttpClient, it might use from cache, it all depends on the url and params you pass in- In theory you could create just one client reusing towards any url you want
- But it's now up to you now: You want a new instance? Injection? Create your own static wrapper? Sure!Remarks
Every client uses the Default configurations, which you can override in appsettings.json
Most default configurations can again be overriden in the Clients constructor
Each HttpClient pool behind the scenes, is based on scheme, url, port and timeoutEach method also take an additional timeout parameter, a different timeout will target a different HttpClient
Each underlying HttpClient is used for default 20 minutes, each TCP connection is maximum reused for 4 minutes and 55 secondsA 502 or 504 response on GET, POST or file request will always be retried once, cannot be turned off unless RetryTimeout is set to 0 in appSettings
A new client wont neccesary create a new HttpClient, it might use from cache, it all depends on the url and params you pass in- In theory you could create just one client reusing towards any url you want
- But it's now up to you now: You want a new instance? Injection? Create your own static wrapper? Sure!Remarks
Every client uses the Default configurations, which you can override in appsettings.json
Most default configurations can again be overriden in the Clients constructor
Each HttpClient pool behind the scenes, is based on scheme, url, port and timeoutEach method also take an additional timeout parameter, a different timeout will target a different HttpClient
Each underlying HttpClient is used for default 20 minutes, each TCP connection is maximum reused for 4 minutes and 55 secondsA 502 or 504 response on GET, POST or file request will always be retried once, cannot be turned off unless RetryTimeout is set to 0 in appSettings
A new client wont neccesary create a new HttpClient, it might use from cache, it all depends on the url and params you pass in- In theory you could create just one client reusing towards any url you want
- But it's now up to you now: You want a new instance? Injection? Create your own static wrapper? Sure!Extension Methods
}