Options
All
  • Public
  • Public/Protected
  • All
Menu

Request builder for OpenAPI requests.

Type parameters

  • ResponseT = any

    Type of the response for the request.

Hierarchy

  • OpenApiRequestBuilder

Index

Constructors

  • new OpenApiRequestBuilder<ResponseT>(method: Method, pathPattern: string, parameters?: OpenApiRequestParameters): OpenApiRequestBuilder<ResponseT>
  • Create an instance of OpenApiRequestBuilder.

    Type parameters

    • ResponseT = any

    Parameters

    • method: Method

      HTTP method of the request to be built.

    • pathPattern: string

      Path for the request containing path parameter references as in the OpenAPI specification.

    • Optional parameters: OpenApiRequestParameters

      Query parameters and or body to pass to the request.

    Returns OpenApiRequestBuilder<ResponseT>

Properties

method: Method

Methods

  • Add custom headers to the request. If a header field with the given name already exists it is overwritten.

    Parameters

    • headers: Record<string, string>

      Key-value pairs denoting additional custom headers.

    Returns OpenApiRequestBuilder<ResponseT>

    The request builder itself, to facilitate method chaining.

  • addCustomRequestConfiguration(requestConfiguration: Record<string, string>): OpenApiRequestBuilder<ResponseT>
  • Add custom request configuration to the request. Typically, this is used when specifying response type for downloading files. If the custom request configuration contains keys in this list defaultDisallowedKeys, they will be removed.

    Parameters

    • requestConfiguration: Record<string, string>

      Key-value pairs denoting additional custom request configuration options to be set in the request.

    Returns OpenApiRequestBuilder<ResponseT>

    The request builder itself, to facilitate method chaining.

  • Execute request and get the response data. Use this to conveniently access the data of a service without technical information about the response.

    Parameters

    Returns Promise<ResponseT>

    A promise resolving to the requested return type.

  • Execute request and get a raw HttpResponse, including all information about the HTTP response. This especially comes in handy, when you need to access the headers or status code of the response.

    Parameters

    Returns Promise<HttpResponse>

    A promise resolving to an HttpResponse.

  • Skip fetching csrf token for this request, which is typically useful when the csrf token is not required.

    Returns OpenApiRequestBuilder<ResponseT>

    The request builder itself, to facilitate method chaining.

    Copyright Ⓒ 2023 SAP SE or an SAP affiliate company. All rights reserved.