Skip to content

Configuration

Hassan F edited this page Feb 6, 2021 · 2 revisions

Constructor Options:

ARH provides few constructor in which they may take several optional argument or a model of parameters as an input. These optional parameters that you may either use directly or within the provided model, are introduced here:

  • baseUrl: This option set a base URL for all other requests
  • fixEndOfUrl: This option try to handle missing or extra / at the end of base URL route, so if someone who doesn't know your request URL tries to add a new URL to your config files, it will handle that.
  • options: This take an instance of RestHandlerInitializerOptions which provides with:
    • FixEndOfUrl: This option try to handle missing or extra / at the end of base URL route, so if someone who doesn't know your request URL tries to add a new URL to your config files, it will handle that.
    • Timeout: Let you set a timeout that overrides HttpClient default timeout setting

E.g. 1:

var client1 = new AdvancedRestHandler()

E.g. 2:

var client2 = new AdvancedRestHandler("https://my-base-url/", true);

E.g. 3:

var client3 = new AdvancedRestHandler("https://my-base-url/", new RestHandlerInitializerOptions{
                  FixEndOfUrl = true
              });

Request Types

Clone this wiki locally