# abstract new BaseOsduClient(api_url)
Parameters:
Name | Type | Description |
---|---|---|
api_url |
string | The url for the OSDU API, with or without a trailing |
Methods
# protected _getHeaders(data_partition) → {Object}
Generate the HTTP headers needed to interact with the OSDU API
Parameters:
Name | Type | Description |
---|---|---|
data_partition |
string | The data partition against which the request is being made |
The common headers required to communicate with the OSDU API
# async protected _makeRequest(data_partition, method, args, iterationopt) → {Promise.<AxiosResponse>}
Common logic to all HTTP requests made to the OSDU API
- For internal client use only
- Handles the automatic generation of common headers, authentication, and retries (up to 3) on error conditions
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
data_partition |
string | The data partition against which the request is being made |
||
method |
function | The axios method reference to call when sending the request ( |
||
args |
Object | The arguments used to invoke the API request |
||
path |
string | The url path to reach out to on the OSDU API (I.E. |
||
body |
Object |
<optional> |
The JSON HTTP body to include with the request |
|
config |
Object |
<optional> |
Any additional Axios config to provide with the request. Note that |
|
iteration |
number |
<optional> |
1 | The iteration of this request. Used for internal recursion and should not be passed in by an external caller |
The response from the Axios client
# protected _refreshAccessToken()
Refresh the access token used to authenticate API Requests
- Not implemented in the base class
Error
# delete(path, data_partition) → {Promise.<Object>}
Convenience method for invoking HTTP DELETE requests
Parameters:
Name | Type | Description |
---|---|---|
path |
string | The url path for the HTTP DELETE request (I.E. |
data_partition |
string | The data partition against which the request is being made |
The response data from the Axios client
# get(path, data_partition) → {Promise.<Object>}
Convenience method for invoking HTTP GET requests
Parameters:
Name | Type | Description |
---|---|---|
path |
string | The url path for the HTTP GET request (I.E. |
data_partition |
string | The data partition against which the request is being made |
The response data from the Axios client
# post(path, body, data_partition) → {Promise.<Object>}
Convenience method for invoking HTTP POST requests
Parameters:
Name | Type | Description |
---|---|---|
path |
string | The url path for the HTTP POST request (I.E. |
body |
Object | The JSON body to send with the HTTP POST request |
data_partition |
string | The data partition against which the request is being made |
The response data from the Axios client
# put(path, body, data_partition) → {Promise.<Object>}
Convenience method for invoking HTTP PUT requests
Parameters:
Name | Type | Description |
---|---|---|
path |
string | The url path for the HTTP PUT request (I.E. |
body |
Object | The JSON body to send with the HTTP PUT request |
data_partition |
string | The data partition against which the request is being made |
The response data from the Axios client