You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| headers | Optional | {} | The object with custom headers for internal http client. |
120
120
| debug | Optional | false | This flag allows seeing the logs of the client. Useful for debugging. |
121
121
| isLaunchMergeRequired | Optional | false | Allows client to merge launches into one at the end of the run via saving their UUIDs to the temp files at filesystem. At the end of the run launches can be merged using `mergeLaunches` method. Temp file format: `rplaunch-${launch_uuid}.tmp`. |
122
-
| restClientConfig | Optional | Not set |`axios` like http client [config](https://github.com/axios/axios#request-config). Supports `proxy` and `noProxy` for proxy configuration (see [Proxy configuration](#proxy-configuration)), `agent` property for [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback)client options, `timeout`, `debug: true` for debugging, and `retry` property (number or [`axios-retry`](https://github.com/softonic/axios-retry#options) config) for automatic retries. |
122
+
| restClientConfig | Optional | Not set |Check the details in the [HTTP client config](#http-client-options). |
123
123
| launchUuidPrint | Optional | false | Whether to print the current launch UUID. |
124
124
| launchUuidPrintOutput | Optional | 'STDOUT' | Launch UUID printing output. Possible values: 'STDOUT', 'STDERR', 'FILE', 'ENVIRONMENT'. Works only if `launchUuidPrint` set to `true`. File format: `rp-launch-uuid-${launch_uuid}.tmp`. Env variable: `RP_LAUNCH_UUID`. |
125
125
| token | Deprecated | Not set | Use `apiKey` or `oauth` instead. |
126
126
127
-
##Asynchronous reporting
127
+
### HTTP client options
128
128
129
-
The client supports an asynchronous reporting (via the ReportPortal asynchronous API).
130
-
If you want the client to report through the asynchronous API, change `v1` to `v2` in the `endpoint` address.
129
+
`axios` like http client [config](https://github.com/axios/axios#request-config).
131
130
132
-
## API
133
-
134
-
Each method (except checkConnect) returns an object in a specific format:
135
-
```javascript
136
-
{
137
-
tempId:'4ds43fs', // generated by the client id for further work with the created item
138
-
promise:Promise// An object indicating the completion of an operation
139
-
}
140
-
```
141
-
The client works synchronously, so it is not necessary to wait for the end of the previous requests to send following ones.
142
-
143
-
### Timeout (30000ms) on axios requests
131
+
#### Timeout (30000ms) on axios requests
144
132
145
133
There is a timeout on axios requests. If for instance the server your making a request to is taking too long to load, then axios timeout will work and you will see the error 'Error: timeout of 30000ms exceeded'.
146
134
147
135
You can simply change this timeout by adding a `timeout` property to `restClientConfig` with your desired numeric value (in _ms_) or *0* to disable it.
148
136
149
-
### Retry configuration
137
+
#### Debug
138
+
139
+
Use `debug: true` for debugging.
140
+
141
+
#### Agent
142
+
143
+
Use `agent` property to provide [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback) agent options.
144
+
Use this property in case the direct `httpAgent/httpsAgent` instance property cannot be used due to config serializations.
145
+
146
+
#### Retry configuration
150
147
151
148
The client retries failed HTTP calls up to 6 times with an exponential backoff (starting at 200 ms and capping at 5 s) and resets the axios timeout before each retry. Provide a `retry` option in `restClientConfig` to change that behaviour. The value can be either a number (overriding just the retry count) or a full [`axios-retry` configuration object](https://github.com/softonic/axios-retry#options):
152
149
@@ -166,13 +163,13 @@ const client = new RPClient({
166
163
167
164
Setting `retry: 0` disables automatic retries.
168
165
169
-
### Proxy configuration
166
+
####Proxy configuration
170
167
171
168
The client supports comprehensive proxy configuration for both HTTP and HTTPS requests, including ReportPortal API calls and OAuth token requests. Proxy settings can be configured via `restClientConfig` or environment variables.
#### Bypassing proxy for specific domains (noProxy)
218
+
#####Bypassing proxy for specific domains (noProxy)
222
219
223
220
Use the `noProxy` option to exclude specific domains from being proxied. This is useful when some services are accessible directly while others require a proxy.
224
221
@@ -245,7 +242,7 @@ const rpClient = new RPClient({
245
242
246
243
**Priority:** Configuration `noProxy` takes precedence over `NO_PROXY` environment variable.
247
244
248
-
#### Proxy with OAuth authentication
245
+
#####Proxy with OAuth authentication
249
246
250
247
When using OAuth authentication, the proxy configuration is automatically applied to both:
251
248
- OAuth token endpoint requests
@@ -273,17 +270,17 @@ const rpClient = new RPClient({
273
270
});
274
271
```
275
272
276
-
#### Advanced proxy scenarios
273
+
#####Advanced proxy scenarios
277
274
278
-
##### Disable proxy explicitly
275
+
######Disable proxy explicitly
279
276
280
277
```javascript
281
278
restClientConfig: {
282
279
proxy:false// Disable proxy even if environment variables are set
283
280
}
284
281
```
285
282
286
-
##### Debug proxy configuration
283
+
######Debug proxy configuration
287
284
288
285
Enable debug mode to see detailed proxy decision logs:
|`noProxy`|`string`| Comma-separated list of domains to bypass proxy |
323
320
324
-
#### How proxy handling works
321
+
#####How proxy handling works
325
322
326
323
1.**Per-request proxy decision:** Each request (API or OAuth) determines its proxy configuration based on the target URL
327
324
2.**noProxy checking:** URLs matching `noProxy` patterns bypass the proxy and connect directly
328
325
3.**Default agents for bypassed URLs:** When a URL bypasses proxy, a default HTTP/HTTPS agent is used to prevent automatic proxy detection
329
326
4.**Environment variable support:**`HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` are automatically detected and used if no explicit configuration is provided
330
327
5.**Priority:** Explicit configuration takes precedence over environment variables
331
328
329
+
## Asynchronous reporting
330
+
331
+
The client supports an asynchronous reporting (via the ReportPortal asynchronous API).
332
+
If you want the client to report through the asynchronous API, change `v1` to `v2` in the `endpoint` address.
333
+
334
+
## API
335
+
336
+
Each method (except checkConnect) returns an object in a specific format:
337
+
```javascript
338
+
{
339
+
tempId:'4ds43fs', // generated by the client id for further work with the created item
340
+
promise:Promise// An object indicating the completion of an operation
341
+
}
342
+
```
343
+
The client works synchronously, so it is not necessary to wait for the end of the previous requests to send following ones.
344
+
332
345
### checkConnect
333
346
334
347
`checkConnect` - asynchronous method for verifying the correctness of the client connection
0 commit comments