UNPKG

ibm-cloud-sdk-core

Version:

Core functionality to support SDKs generated with IBM's OpenAPI SDK Generator.

56 lines (27 loc) 1.9 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [ibm-cloud-sdk-core](./ibm-cloud-sdk-core.md) &gt; [BaseService](./ibm-cloud-sdk-core.baseservice.md) &gt; [createRequest](./ibm-cloud-sdk-core.baseservice.createrequest.md) ## BaseService.createRequest() method Wrapper around `sendRequest` that enforces the request will be authenticated. **Signature:** ```typescript protected createRequest(parameters: any): Promise<any>; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> parameters </td><td> any </td><td> Service request options passed in by user. This should be an object with the following fields: - options.method: the http method - options.url: the path portion of the URL to be appended to the serviceUrl - options.path: the path parameters to be inserted into the URL - options.qs: the querystring to be included in the URL - options.body: the data to be sent as the request body - options.form: an object containing the key/value pairs for a www-form-urlencoded request. - options.formData: an object containing the contents for a multipart/form-data request The following processing is performed on formData values: - string: no special processing -- the value is sent as is - object: the value is converted to a JSON string before insertion into the form body - NodeJS.ReadableStream\|Buffer\|FileWithMetadata: sent as a file, with any associated metadata - array: each element of the array is sent as a separate form part using any special processing as described above - defaultOptions.serviceUrl: the base URL of the service - defaultOptions.headers: additional HTTP headers to be sent with the request </td></tr> </tbody></table> **Returns:** Promise&lt;any&gt; a Promise