Request builder for OpenAPI requests.

Type Parameters

  • ResponseT = any

    Type of the response for the request.

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.

    • Optionalparameters: OpenApiRequestParameters

      Query parameters and or body to pass to the request.

    • OptionalbasePath: string

      The custom path to be prefixed to the API path pattern.

    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 this

    The request builder itself, to facilitate method chaining.

  • 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 @sap-cloud-sdk/http-client!defaultDisallowedKeys, they will be removed.

    Parameters

    • requestConfiguration: CustomRequestConfig

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

    Returns this

    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.

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

    Parameters

    Returns this

    The request builder itself, to facilitate method chaining.

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

    Parameters

    • ...middlewares: HttpMiddleware[]

      Middlewares to be applied to the executeHttpRequest().

    Returns this

    The request builder itself, to facilitate method chaining.

  • Set the custom base path that gets prefixed to the API path parameter before a request.

    Parameters

    • basePath: string

      Base path to be set.

    Returns this

    The request builder itself, to facilitate method chaining.

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

    Returns this

    The request builder itself, to facilitate method chaining.

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