SAP AI SDK for JavaScript - v2.8.0
    Preparing search index...

    Class OpenApiRequestBuilder<ResponseT>

    Request builder for OpenAPI requests.

    Type Parameters

    • ResponseT

      Type of the response for the request.

    Hierarchy

    • OpenApiRequestBuilder<ResponseT>
      • OpenApiRequestBuilder
    Index

    Constructors

    • Type Parameters

      • ResponseT

        Type of the response for the request.

      Parameters

      • method: Method
      • pathPattern: string
      • Optionalparameters: OpenApiRequestParameters
      • OptionalbasePath: string

      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

      • Optionaldestination:
            | never
            | Without<HttpDestination> & DestinationFetchOptions & {
                serviceBindingTransformFn?: ServiceBindingTransformFunction;
            } & { destinationName: string; service?: undefined }
            | Without<
                DestinationFetchOptions & {
                    serviceBindingTransformFn?: ServiceBindingTransformFunction;
                } & { destinationName: string; service?: undefined },
            > & Destination & { url: string }

        The destination to execute the request against.

        • never
        • Without<HttpDestination> & DestinationFetchOptions & {
              serviceBindingTransformFn?: ServiceBindingTransformFunction;
          } & { destinationName: string; service?: undefined }
          • OptionalserviceBindingTransformFn?: ServiceBindingTransformFunction

            Custom transformation function to control how a Destination is built from the given Service.

          • destinationName: string

            The name of the destination to retrieve from service bindings.

          • Optionalservice?: undefined
        • Without<
              DestinationFetchOptions & {
                  serviceBindingTransformFn?: ServiceBindingTransformFunction;
              } & { destinationName: string; service?: undefined },
          > & Destination & { url: string }
      • OptionalrequestConfig: CustomRequestConfig

        Custom request configuration.

      Returns Promise<ResponseT>

      A promise resolving to the requested return type.

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

      Parameters

      • Optionaldestination:
            | never
            | Without<HttpDestination> & DestinationFetchOptions & {
                serviceBindingTransformFn?: ServiceBindingTransformFunction;
            } & { destinationName: string; service?: undefined }
            | Without<
                DestinationFetchOptions & {
                    serviceBindingTransformFn?: ServiceBindingTransformFunction;
                } & { destinationName: string; service?: undefined },
            > & Destination & { url: string }

        The destination to execute the request against.

        • never
        • Without<HttpDestination> & DestinationFetchOptions & {
              serviceBindingTransformFn?: ServiceBindingTransformFunction;
          } & { destinationName: string; service?: undefined }
          • OptionalserviceBindingTransformFn?: ServiceBindingTransformFunction

            Custom transformation function to control how a Destination is built from the given Service.

          • destinationName: string

            The name of the destination to retrieve from service bindings.

          • Optionalservice?: undefined
        • Without<
              DestinationFetchOptions & {
                  serviceBindingTransformFn?: ServiceBindingTransformFunction;
              } & { destinationName: string; service?: undefined },
          > & Destination & { url: string }
      • OptionalrequestConfig: CustomRequestConfig

        Custom request configuration.

      Returns Promise<HttpResponse>

      A promise resolving to an HttpResponse.

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

      Parameters

      • middlewares: HttpMiddleware | HttpMiddleware[]

        Middlewares to be applied to the executeHttpRequest().

      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.

    • Get HTTP request config.

      Returns Promise<HttpRequestConfigWithOrigin>

      Promise of the HTTP request config with origin.

    • 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 Ⓒ 2026 SAP SE or an SAP affiliate company. All rights reserved.