Skip to content

📦 Http request as Builder & Retry pattern for easier to use and reduce the possibility of failed.

License

Notifications You must be signed in to change notification settings

RezaAmd/Http.Request.Builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Http.Request.Builder

NuGet

An .net package for easier sending request as builder use retry pattern.

Http request as builder pattern for easier to use. You can config it to try request again a few more times, if the request was failed. You can map the response in an object of class.

How to install?

In .Net - NuGet:

Install-Package Http.Request.Builder

Quick use:

// Prepare request object.
var request = RequestBuilder.Create("YOUR_URL")
    .Build();
    
// Send request and get response.
var response = await request.SendAsync();

//Console.WriteLine($"{response.StatusCode} {response.Content}");

Configs

var request = RequestBuilder.Create("YOUR_URL")

    .WithBearerToken("JWT_TOKEN")             // <--- Authentication as bearer token here!
    .WithHeader("Accept", "application/json") // <--- Your custom headers!
    .WithHeader("CUSTOM_KEY", "CUSTOM_VALUE") // <--- Your custom headers!
    .WithRetryAttemptsForFailed(3)            //   <--- Number of retries after failure!

    .Build();

About

📦 Http request as Builder & Retry pattern for easier to use and reduce the possibility of failed.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages