Options
All
  • Public
  • Public/Protected
  • All
Menu

Builder

A builder that can build HttpRequests.

Hierarchy

  • Builder

Index

Constructors

constructor

Properties

Private authUrl

authUrl: string

Private body

body: object

Private cookies

cookies: Record<string, string>

Private encodeBodyAsJson

encodeBodyAsJson: boolean

Private followRedirects

followRedirects: boolean

Private form

form: Record<string, string>

Private headers

headers: Record<string, string[]>

Private method

method: HttpMethod

Private url

url: string

Methods

build

withAuthUrl

  • withAuthUrl(authUrl: string): this
  • Sets the Url that will be used to capture cookies for authentication before the actual request is executed.

    Parameters

    • authUrl: string

      the Url that will be used to capture cookies for authentication before the actual request is executed.

    Returns this

    the builder.

withBody

  • withBody(body: any): this
  • Sets the body that will be included in the request. If encodeBodyAsJson is not set (or is set to false) the body must either be a {@link String} or a {@link Binary} or else the request will fail when executed on Stitch.

    Parameters

    • body: any

      the body that will be included in the request.

    Returns this

    the builder.

withCookies

  • withCookies(cookies: Record<string, string>): this
  • Sets the cookies that will be included in the request.

    Parameters

    • cookies: Record<string, string>

      the cookies that will be included in the request.

    Returns this

    the builder.

withEncodeBodyAsJson

  • withEncodeBodyAsJson(encodeBodyAsJson: boolean): this
  • Sets whether or not the included body should be encoded as extended JSON when sent to the url in this request. Defaults to false.

    See Also

    Builder#withBody withBody

    Parameters

    • encodeBodyAsJson: boolean

      whether or not the included body should be encoded as extended JSON when sent to the url in this request.

    Returns this

    the builder.

withFollowRedirects

  • withFollowRedirects(followRedirects: boolean): this
  • Sets whether or not Stitch should follow redirects while executing the request. Defaults to false.

    Parameters

    • followRedirects: boolean

      whether or not Stitch should follow redirects while executing the request. Defaults to false.

    Returns this

    the builder.

withForm

  • withForm(form: Record<string, string>): this
  • Sets the form that will be included in the request.

    Parameters

    • form: Record<string, string>

      the form that will be included in the request.

    Returns this

    the builder.

withHeaders

  • withHeaders(headers: Record<string, string[]>): this
  • Sets the headers that will be included in the request.

    Parameters

    • headers: Record<string, string[]>

      the headers that will be included in the request.

    Returns this

    the builder.

withMethod

withUrl

  • withUrl(url: string): this
  • Sets the Url that the request will be performed against.

    Parameters

    • url: string

      the Url that the request will be performed against.

    Returns this

    the builder.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc