# Class OpenApiRequestBuilder<ResponseT>

Request builder for OpenAPI requests.

#### Type Parameters

- ResponseT

  Type of the response for the request.

#### Hierarchy

- OpenApiRequestBuilder<ResponseT>
  - OpenApiRequestBuilder

- Defined in packages/core/dist/openapi-request-builder.d.ts:9

##### Index

### Constructors

constructor

### Properties

method

### Methods

addCustomHeaders
addCustomRequestConfiguration
execute
executeRaw
middleware
requestConfig
setBasePath
skipCsrfTokenFetching

## Constructors

### constructor

- new OpenApiRequestBuilder<ResponseT>(
  method: Method,
  pathPattern: string,
  parameters?: OpenApiRequestParameters,
  basePath?: string,
  ): OpenApiRequestBuilder<ResponseT>

  #### Type Parameters

  - ResponseT

    Type of the response for the request.

  #### Parameters

  - method: Method
  - pathPattern: string
  - `Optional` parameters: OpenApiRequestParameters
  - `Optional` basePath: string

  #### Returns OpenApiRequestBuilder<ResponseT>

  Overrides CloudSDKOpenApiRequestBuilder<ResponseT>.constructor

  - Defined in packages/core/dist/openapi-request-builder.d.ts:10

## Properties

### method

method: Method

Inherited from CloudSDKOpenApiRequestBuilder.method

- Defined in node_modules/.pnpm/@sap-cloud-sdk+openapi@4.7.0/node_modules/@sap-cloud-sdk/openapi/dist/openapi-request-builder.d.ts:9

## Methods

### addCustomHeaders

- addCustomHeaders(headers: Record<string, string>): this

  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.

  Inherited from CloudSDKOpenApiRequestBuilder.addCustomHeaders

  - Defined in node_modules/.pnpm/@sap-cloud-sdk+openapi@4.7.0/node_modules/@sap-cloud-sdk/openapi/dist/openapi-request-builder.d.ts:30

### addCustomRequestConfiguration

- addCustomRequestConfiguration(requestConfiguration: CustomRequestConfig): this

  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.

  Inherited from CloudSDKOpenApiRequestBuilder.addCustomRequestConfiguration

  - Defined in node_modules/.pnpm/@sap-cloud-sdk+openapi@4.7.0/node_modules/@sap-cloud-sdk/openapi/dist/openapi-request-builder.d.ts:37

### execute

- execute(
  destination?:
  | never
  | Without<HttpDestination> & DestinationFetchOptions & {
  serviceBindingTransformFn?: ServiceBindingTransformFunction;
  } & { destinationName: string; service?: undefined }
  | Without<
  DestinationFetchOptions & {
  serviceBindingTransformFn?: ServiceBindingTransformFunction;
  } & { destinationName: string; service?: undefined },
  > & Destination & { url: string },
  requestConfig?: CustomRequestConfig,
  ): Promise<ResponseT>

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

  #### Parameters

  - `Optional` destination:
    | 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 }

      - ##### `Optional` serviceBindingTransformFn?: 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.

      - ##### `Optional` service?: undefined

    - Without<
      DestinationFetchOptions & {
      serviceBindingTransformFn?: ServiceBindingTransformFunction;
      } & { destinationName: string; service?: undefined },
      > & Destination & { url: string }
  - `Optional` requestConfig: CustomRequestConfig

    Custom request configuration.

  #### Returns Promise<ResponseT>

  A promise resolving to the requested return type.

  Overrides CloudSDKOpenApiRequestBuilder.execute

  - Defined in packages/core/dist/openapi-request-builder.d.ts:24

### executeRaw

- executeRaw(
  destination?:
  | never
  | Without<HttpDestination> & DestinationFetchOptions & {
  serviceBindingTransformFn?: ServiceBindingTransformFunction;
  } & { destinationName: string; service?: undefined }
  | Without<
  DestinationFetchOptions & {
  serviceBindingTransformFn?: ServiceBindingTransformFunction;
  } & { destinationName: string; service?: undefined },
  > & Destination & { url: string },
  requestConfig?: CustomRequestConfig,
  ): Promise<HttpResponse>

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

  #### Parameters

  - `Optional` destination:
    | 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 }

      - ##### `Optional` serviceBindingTransformFn?: 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.

      - ##### `Optional` service?: undefined

    - Without<
      DestinationFetchOptions & {
      serviceBindingTransformFn?: ServiceBindingTransformFunction;
      } & { destinationName: string; service?: undefined },
      > & Destination & { url: string }
  - `Optional` requestConfig: CustomRequestConfig

    Custom request configuration.

  #### Returns Promise<HttpResponse>

  A promise resolving to an HttpResponse.

  Overrides CloudSDKOpenApiRequestBuilder.executeRaw

  - Defined in packages/core/dist/openapi-request-builder.d.ts:17

### middleware

- middleware(middlewares: HttpMiddleware | HttpMiddleware[]): this

  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.

  Inherited from CloudSDKOpenApiRequestBuilder.middleware

  - Defined in node_modules/.pnpm/@sap-cloud-sdk+openapi@4.7.0/node_modules/@sap-cloud-sdk/openapi/dist/openapi-request-builder.d.ts:48
- middleware(...middlewares: HttpMiddleware[]): this

  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.

  Inherited from CloudSDKOpenApiRequestBuilder.middleware

  - Defined in node_modules/.pnpm/@sap-cloud-sdk+openapi@4.7.0/node_modules/@sap-cloud-sdk/openapi/dist/openapi-request-builder.d.ts:49

### `Protected` requestConfig

- requestConfig(): Promise<HttpRequestConfigWithOrigin>

  Get HTTP request config.

  #### Returns Promise<HttpRequestConfigWithOrigin>

  Promise of the HTTP request config with origin.

  Inherited from CloudSDKOpenApiRequestBuilder.requestConfig

  - Defined in node_modules/.pnpm/@sap-cloud-sdk+openapi@4.7.0/node_modules/@sap-cloud-sdk/openapi/dist/openapi-request-builder.d.ts:73

### setBasePath

- setBasePath(basePath: string): this

  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.

  Inherited from CloudSDKOpenApiRequestBuilder.setBasePath

  - Defined in node_modules/.pnpm/@sap-cloud-sdk+openapi@4.7.0/node_modules/@sap-cloud-sdk/openapi/dist/openapi-request-builder.d.ts:68

### skipCsrfTokenFetching

- skipCsrfTokenFetching(): this

  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.

  Inherited from CloudSDKOpenApiRequestBuilder.skipCsrfTokenFetching

  - Defined in node_modules/.pnpm/@sap-cloud-sdk+openapi@4.7.0/node_modules/@sap-cloud-sdk/openapi/dist/openapi-request-builder.d.ts:42