Request builder for OpenAPI requests.

Type Parameters

  • ResponseT = any

    Type of the response for the request.

Hierarchy

  • OpenApiRequestBuilder

Constructors

  • 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.

    Returns

    The request builder itself, to facilitate method chaining.

    Parameters

    • headers: Record<string, string>

      Key-value pairs denoting additional custom headers.

    Returns 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.

    Returns

    The request builder itself, to facilitate method chaining.

    Parameters

    • requestConfiguration: Record<string, string>

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

    Returns OpenApiRequestBuilder<ResponseT>

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

    Returns

    A promise resolving to the requested return type.

    Parameters

    Returns Promise<ResponseT>

  • 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.

    Returns

    A promise resolving to an HttpResponse.

    Parameters

    Returns Promise<HttpResponse>

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

    Returns

    The request builder itself, to facilitate method chaining.

    Returns OpenApiRequestBuilder<ResponseT>

  • Set timeout for requests towards the target system given in the destination.

    Returns

    The request builder itself, to facilitate method chaining.

    Deprecated

    Since v2.13.0. The timeout configuration is replaced by the more general middleware approach in version 3.0 of the SAP Cloud SDK.

    Parameters

    • timeout: number

      Value is in milliseconds and default value is 10000 (10 seconds).

    Returns OpenApiRequestBuilder<ResponseT>

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