System Library Common Framework
Search Results for

    *.Benchmark*,*.Tests*,*.ApiTests*,*.BaseTest*,DelegateJsonConverter,CalleeCancelledRequestException,ClientResponse,ContentType,OutputCachePolicy
    Show / Hide Table of Contents Show / Hide Table of Contents
    NamespaceSystemLibrary.Common.Framework.App SystemLibrary.Common.Framework.Client.dll

    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 504

    Options:

    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, TRACE
    Remarks
    X

    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 timeout

    Each 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 seconds

    A 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
    object
    Client
    Examples
    X

    You can simply "var client = new Client()" if you want and use the methods directly or inherit it and base all your integrations on it, sharing headers or other methods you would like.

    A simple class and HttpBinClient:

    class HttpBinResponse
     {
         public string Url { get; set; }
     }
    class HttpBinClient : Client
    {
        const string apiUrl = "http://httpbin.org";
    
        public HttpBinClient() : base(useRetryPolicy: true)
        {
        }
    
        public HttpBinResponse Get()
        {
            return base.Get<HttpBinResponse>(apiUrl + "/get").Data;
        }
    }

    Running the above Client and Response in a UnitTest project as such:

    [TestMethod]
     public void Test()
     {
         var client = new HttpBinClient();
    
         var response = client.Get();
    
         Assert.IsTrue(response.Url.Contains("http"));
         //Visit: http://httpbin.org/get to see the actual value of 'url', then you know this Assert statement is true
     }

    Another example of using the Client directly:

    public void Test()
     {
         var client = new Client();
    
         var response = client.Get<string>("http://httpbin.org/get");
    
         Assert.IsTrue(response.Contains("http"));
         //Response is now the whole json (or any data actually as a string) text that the url: http://httpbin.org/get is returning
     }

    Another example returning HttpResponseMessage as is, for you to read the stream/content of the response yourself:

    public void Test() 
     {
         var client = new Client();
         var response = = client.Get<HttpResponseMessage>("http://httpbin.org/get");
         var httpResponseMessage = response.Data;
         // httpResponseMessage now is ready to be read if you need to read it manually, as in: it's not a json/xml/serialization type of response, but maybe an Stream/Image you need to read...
     }
    Arguments
    X

    Constructors

    Create a new client

    Remarks
    X

    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 timeout

    Each 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 seconds

    A 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!

    public Client(int? timeout = null, bool? useRetryPolicy = null, bool? ignoreSslErrors = null, int? retryTimeout = null, bool? useRequestBreakerPolicy = null, bool? throwOnUnsuccessful = null, bool? useAutomaticDecompression = null, bool? expectContinue = null)

    X
    Methods arguments
    Type Name Description
    int? timeout

    Override default from appSettings

    bool? useRetryPolicy

    Override default from appSettings

    bool? ignoreSslErrors

    Override default from appSettings

    int? retryTimeout

    Override default from appSettings

    bool? useRequestBreakerPolicy

    Override default from appSettings

    bool? throwOnUnsuccessful

    Override default from appSettings

    bool? useAutomaticDecompression

    Override default from appSettings

    bool? expectContinue

    Methods

    Send a HTTP DELETE async request

    Remarks
    X

    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 timeout

    Each 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 seconds

    A 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!

    public Task<ClientResponse<T>> DeleteAsync<T>(string url, object data, ContentType contentType = ContentType.Auto, IDictionary<string, string> headers = null, int timeoutMilliseconds = 40001, JsonSerializerOptions jsonSerializerOptions = null, CancellationToken cancellationToken = default, Func<string, T> deserialize = null)

    X
    var deleteId = 1;
    var response = await new Client().DeleteAsync<string>("https://www.systemlibrary.com/delete", deleteId, ContentType.textplain, 2000);
    X
    Generic types
    Name Description
    T
    Methods arguments
    Type Name Description
    string url
    object data
    contentType
    IDictionary<string, string> headers
    int timeoutMilliseconds
    JsonSerializerOptions jsonSerializerOptions
    CancellationToken cancellationToken
    Func<string, T> deserialize
    X
    Type Description
    Task<<T>>

    Send a HTTP DELETE request

    Remarks
    X

    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 timeout

    Each 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 seconds

    A 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!

    public ClientResponse<T> Delete<T>(string url, object data, ContentType contentType = ContentType.Auto, IDictionary<string, string> headers = null, int timeoutMilliseconds = 40001, JsonSerializerOptions jsonSerializerOptions = null, CancellationToken cancellationToken = default, Func<string, T> deserialize = null)

    X
    var deleteId = 1;
    var response = new Client().Delete<string>("https://www.systemlibrary.com/delete", deleteId, ContentType.textplain, 2000);
    X
    Generic types
    Name Description
    T
    Methods arguments
    Type Name Description
    string url
    object data
    contentType
    IDictionary<string, string> headers
    int timeoutMilliseconds
    JsonSerializerOptions jsonSerializerOptions
    CancellationToken cancellationToken
    Func<string, T> deserialize
    X
    Type Description
    <T>

    Send a HTTP GET request with a payload

    Remarks
    X

    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 timeout

    Each 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 seconds

    A 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!

    public Task<ClientResponse<T>> GetAsync<T>(string url, ContentType contentType = ContentType.Auto, IDictionary<string, string> headers = null, int timeoutMilliseconds = 40001, JsonSerializerOptions jsonSerializerOptions = null, object payload = null, CancellationToken cancellationToken = default, Func<string, T> deserialize = null)

    X
    var data = new { hello: "world"};
    var response = new Client().Get<string>("https://www.systemlibrary.com/get", data, ContentType.json, 2000);
    X
    Generic types
    Name Description
    T
    Methods arguments
    Type Name Description
    string url
    contentType
    IDictionary<string, string> headers
    int timeoutMilliseconds
    JsonSerializerOptions jsonSerializerOptions
    object payload
    CancellationToken cancellationToken
    Func<string, T> deserialize
    X
    Type Description
    Task<<T>>

    Send a HTTP GET request

    Remarks
    X

    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 timeout

    Each 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 seconds

    A 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!

    public Task<ClientResponse<T>> GetAsync<T>(string url, ContentType contentType = ContentType.Auto, IDictionary<string, string> headers = null, int timeoutMilliseconds = 40001, JsonSerializerOptions jsonSerializerOptions = null, CancellationToken cancellationToken = default, Func<string, T> deserialize = null)

    X
    var response = await new Client().GetAsync<string>("https://www.systemlibrary.com/get", ContentType.json, 2000);
    X
    Generic types
    Name Description
    T
    Methods arguments
    Type Name Description
    string url
    contentType
    IDictionary<string, string> headers
    int timeoutMilliseconds
    JsonSerializerOptions jsonSerializerOptions
    CancellationToken cancellationToken
    Func<string, T> deserialize
    X
    Type Description
    Task<<T>>

    Send a HTTP GET request with a payload

    Remarks
    X

    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 timeout

    Each 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 seconds

    A 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!

    public ClientResponse<T> Get<T>(string url, ContentType contentType = ContentType.Auto, IDictionary<string, string> headers = null, int timeoutMilliseconds = 40001, JsonSerializerOptions jsonSerializerOptions = null, object payload = null, CancellationToken cancellationToken = default, Func<string, T> deserialize = null)

    X
    var data = new { hello: "world"};
    var response = new Client().Get<string>("https://www.systemlibrary.com/get", data, ContentType.json, 2000);
    X
    Generic types
    Name Description
    T
    Methods arguments
    Type Name Description
    string url
    contentType
    IDictionary<string, string> headers
    int timeoutMilliseconds
    JsonSerializerOptions jsonSerializerOptions
    object payload
    CancellationToken cancellationToken
    Func<string, T> deserialize
    X
    Type Description
    <T>

    Send a HTTP HEAD async request

    Remarks
    X

    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 timeout

    Each 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 seconds

    A 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!

    public Task<ClientResponse<T>> HeadAsync<T>(string url, IDictionary<string, string> headers = null, int timeoutMilliseconds = 40001, JsonSerializerOptions jsonSerializerOptions = null, CancellationToken cancellationToken = default, Func<string, T> deserialize = null)

    X
    var response = await new Client().HeadAsync<string>("https://www.systemlibrary.com/head", ContentType.json, 2000);
    X
    Generic types
    Name Description
    T
    Methods arguments
    Type Name Description
    string url
    IDictionary<string, string> headers
    int timeoutMilliseconds
    JsonSerializerOptions jsonSerializerOptions
    CancellationToken cancellationToken
    Func<string, T> deserialize
    X
    Type Description
    Task<<T>>

    Send a HTTP HEAD request

    Remarks
    X

    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 timeout

    Each 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 seconds

    A 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!

    public ClientResponse<T> Head<T>(string url, IDictionary<string, string> headers = null, int timeoutMilliseconds = 40001, JsonSerializerOptions jsonSerializerOptions = null, CancellationToken cancellationToken = default, Func<string, T> deserialize = null)

    X
    var response = new Client().Head<string>("https://www.systemlibrary.com/head", ContentType.json, 2000);
    X
    Generic types
    Name Description
    T
    Methods arguments
    Type Name Description
    string url
    IDictionary<string, string> headers
    int timeoutMilliseconds
    JsonSerializerOptions jsonSerializerOptions
    CancellationToken cancellationToken
    Func<string, T> deserialize
    X
    Type Description
    <T>

    Send a HTTP OPTIONS request

    Remarks
    X

    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 timeout

    Each 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 seconds

    A 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!

    public Task<ClientResponse<T>> OptionsAsync<T>(string url, IDictionary<string, string> headers = null, int timeoutMilliseconds = 40001, CancellationToken cancellationToken = default, Func<string, T> deserialize = null)

    X
    var response = await new Client().OptionsAsyncT<string>("https://www.systemlibrary.com/options");
    X
    Generic types
    Name Description
    T
    Methods arguments
    Type Name Description
    string url
    IDictionary<string, string> headers
    int timeoutMilliseconds
    CancellationToken cancellationToken
    Func<string, T> deserialize
    X
    Type Description
    Task<<T>>

    Send a HTTP OPTIONS request

    Remarks
    X

    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 timeout

    Each 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 seconds

    A 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!

    public ClientResponse<T> Options<T>(string url, IDictionary<string, string> headers = null, int timeoutMilliseconds = 40001, CancellationToken cancellationToken = default, Func<string, T> deserialize = null)

    X
    var response = new Client().Options<string>("https://www.systemlibrary.com/options");
    X
    Generic types
    Name Description
    T
    Methods arguments
    Type Name Description
    string url
    IDictionary<string, string> headers
    int timeoutMilliseconds
    CancellationToken cancellationToken
    Func<string, T> deserialize
    X
    Type Description
    <T>

    Send a HTTP POST async request

    Remarks
    X

    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 timeout

    Each 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 seconds

    A 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!

    public Task<ClientResponse<T>> PostAsync<T>(string url, object data, ContentType contentType = ContentType.Auto, IDictionary<string, string> headers = null, int timeoutMilliseconds = 40001, JsonSerializerOptions jsonSerializerOptions = null, CancellationToken cancellationToken = default, Func<string, T> deserialize = null)

    X
    var postId = 1;
    var response = await new Client().PostAsync<string>("https://www.systemlibrary.com/post", postId, ContentType.textplain, 2000);
    X
    Generic types
    Name Description
    T
    Methods arguments
    Type Name Description
    string url
    object data
    contentType
    IDictionary<string, string> headers
    int timeoutMilliseconds
    JsonSerializerOptions jsonSerializerOptions
    CancellationToken cancellationToken
    Func<string, T> deserialize
    X
    Type Description
    Task<<T>>

    Send a HTTP POST request

    Remarks
    X

    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 timeout

    Each 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 seconds

    A 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!

    public ClientResponse<T> Post<T>(string url, object data = null, ContentType contentType = ContentType.Auto, IDictionary<string, string> headers = null, int timeoutMilliseconds = 40001, JsonSerializerOptions jsonSerializerOptions = null, CancellationToken cancellationToken = default, Func<string, T> deserialize = null)

    X
    var postId = 1;
    var response = new Client().Post<string>("https://www.systemlibrary.com/post", postId, ContentType.textplain, 2000);
    X
    Generic types
    Name Description
    T
    Methods arguments
    Type Name Description
    string url
    object data
    contentType
    IDictionary<string, string> headers
    int timeoutMilliseconds
    JsonSerializerOptions jsonSerializerOptions
    CancellationToken cancellationToken
    Func<string, T> deserialize
    X
    Type Description
    <T>

    Send a HTTP PUT async request

    Remarks
    X

    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 timeout

    Each 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 seconds

    A 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!

    public Task<ClientResponse<T>> PutAsync<T>(string url, object data, ContentType contentType = ContentType.Auto, IDictionary<string, string> headers = null, int timeoutMilliseconds = 40001, JsonSerializerOptions jsonSerializerOptions = null, CancellationToken cancellationToken = default, Func<string, T> deserialize = null)

    X
    var putId = 1;
    var response = await new Client().PutAsync<string>("https://www.systemlibrary.com/put", putId, ContentType.textplain, 2000);
    X
    Generic types
    Name Description
    T
    Methods arguments
    Type Name Description
    string url
    object data
    contentType
    IDictionary<string, string> headers
    int timeoutMilliseconds
    JsonSerializerOptions jsonSerializerOptions
    CancellationToken cancellationToken
    Func<string, T> deserialize
    X
    Type Description
    Task<<T>>

    Send a HTTP PUT request

    Remarks
    X

    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 timeout

    Each 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 seconds

    A 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!

    public ClientResponse<T> Put<T>(string url, object data, ContentType contentType = ContentType.Auto, IDictionary<string, string> headers = null, int timeoutMilliseconds = 40001, JsonSerializerOptions jsonSerializerOptions = null, CancellationToken cancellationToken = default, Func<string, T> deserialize = null)

    X
    var putId = 1;
    var response = new Client().Put<string>("https://www.systemlibrary.com/put", putId, ContentType.textplain, 2000);
    X
    Generic types
    Name Description
    T
    Methods arguments
    Type Name Description
    string url
    object data
    contentType
    IDictionary<string, string> headers
    int timeoutMilliseconds
    JsonSerializerOptions jsonSerializerOptions
    CancellationToken cancellationToken
    Func<string, T> deserialize
    X
    Type Description
    <T>

    Extension Methods

    ObjectExtensions.Json(object, bool)
    ObjectExtensions.Json(object, JsonSerializerOptions, bool, params JsonConverter[])
    ObjectExtensions.Json(object, params JsonConverter[])
    ObjectExtensions.Xml(object)

    }

    In This Article
    Package: nuget
    Source: github
    Website: System Library Common Framework