|
| 1 | +[algotstest](../README.md) / [algo-http-client-with-retry](../modules/algo_http_client_with_retry.md) / AlgoHttpClientWithRetry |
| 2 | + |
| 3 | +# Class: AlgoHttpClientWithRetry |
| 4 | + |
| 5 | +[algo-http-client-with-retry](../modules/algo_http_client_with_retry.md).AlgoHttpClientWithRetry |
| 6 | + |
| 7 | +A HTTP Client that wraps the Algorand SDK HTTP Client with retries |
| 8 | + |
| 9 | +## Hierarchy |
| 10 | + |
| 11 | +- [`URLTokenBaseHTTPClient`](urlTokenBaseHTTPClient.URLTokenBaseHTTPClient.md) |
| 12 | + |
| 13 | + ↳ **`AlgoHttpClientWithRetry`** |
| 14 | + |
| 15 | +## Table of contents |
| 16 | + |
| 17 | +### Constructors |
| 18 | + |
| 19 | +- [constructor](algo_http_client_with_retry.AlgoHttpClientWithRetry.md#constructor) |
| 20 | + |
| 21 | +### Properties |
| 22 | + |
| 23 | +- [MAX\_BACKOFF\_MS](algo_http_client_with_retry.AlgoHttpClientWithRetry.md#max_backoff_ms) |
| 24 | +- [MAX\_TRIES](algo_http_client_with_retry.AlgoHttpClientWithRetry.md#max_tries) |
| 25 | +- [RETRY\_ERROR\_CODES](algo_http_client_with_retry.AlgoHttpClientWithRetry.md#retry_error_codes) |
| 26 | +- [RETRY\_STATUS\_CODES](algo_http_client_with_retry.AlgoHttpClientWithRetry.md#retry_status_codes) |
| 27 | + |
| 28 | +### Methods |
| 29 | + |
| 30 | +- [callWithRetry](algo_http_client_with_retry.AlgoHttpClientWithRetry.md#callwithretry) |
| 31 | +- [delete](algo_http_client_with_retry.AlgoHttpClientWithRetry.md#delete) |
| 32 | +- [get](algo_http_client_with_retry.AlgoHttpClientWithRetry.md#get) |
| 33 | +- [post](algo_http_client_with_retry.AlgoHttpClientWithRetry.md#post) |
| 34 | + |
| 35 | +## Constructors |
| 36 | + |
| 37 | +### constructor |
| 38 | + |
| 39 | +• **new AlgoHttpClientWithRetry**(`tokenHeader`, `baseServer`, `port?`, `defaultHeaders?`) |
| 40 | + |
| 41 | +#### Parameters |
| 42 | + |
| 43 | +| Name | Type | |
| 44 | +| :------ | :------ | |
| 45 | +| `tokenHeader` | [`TokenHeader`](../modules/urlTokenBaseHTTPClient.md#tokenheader) | |
| 46 | +| `baseServer` | `string` | |
| 47 | +| `port?` | `string` \| `number` | |
| 48 | +| `defaultHeaders` | `Record`<`string`, `any`\> | |
| 49 | + |
| 50 | +#### Inherited from |
| 51 | + |
| 52 | +[URLTokenBaseHTTPClient](urlTokenBaseHTTPClient.URLTokenBaseHTTPClient.md).[constructor](urlTokenBaseHTTPClient.URLTokenBaseHTTPClient.md#constructor) |
| 53 | + |
| 54 | +#### Defined in |
| 55 | + |
| 56 | +[urlTokenBaseHTTPClient.ts:45](https://github.com/algorandfoundation/algokit-utils-ts/blob/4edaa90/src/urlTokenBaseHTTPClient.ts#L45) |
| 57 | + |
| 58 | +## Properties |
| 59 | + |
| 60 | +### MAX\_BACKOFF\_MS |
| 61 | + |
| 62 | +▪ `Static` `Private` `Readonly` **MAX\_BACKOFF\_MS**: ``10000`` |
| 63 | + |
| 64 | +#### Defined in |
| 65 | + |
| 66 | +[algo-http-client-with-retry.ts:8](https://github.com/algorandfoundation/algokit-utils-ts/blob/4edaa90/src/algo-http-client-with-retry.ts#L8) |
| 67 | + |
| 68 | +___ |
| 69 | + |
| 70 | +### MAX\_TRIES |
| 71 | + |
| 72 | +▪ `Static` `Private` `Readonly` **MAX\_TRIES**: ``5`` |
| 73 | + |
| 74 | +#### Defined in |
| 75 | + |
| 76 | +[algo-http-client-with-retry.ts:7](https://github.com/algorandfoundation/algokit-utils-ts/blob/4edaa90/src/algo-http-client-with-retry.ts#L7) |
| 77 | + |
| 78 | +___ |
| 79 | + |
| 80 | +### RETRY\_ERROR\_CODES |
| 81 | + |
| 82 | +▪ `Static` `Private` `Readonly` **RETRY\_ERROR\_CODES**: `string`[] |
| 83 | + |
| 84 | +#### Defined in |
| 85 | + |
| 86 | +[algo-http-client-with-retry.ts:13](https://github.com/algorandfoundation/algokit-utils-ts/blob/4edaa90/src/algo-http-client-with-retry.ts#L13) |
| 87 | + |
| 88 | +___ |
| 89 | + |
| 90 | +### RETRY\_STATUS\_CODES |
| 91 | + |
| 92 | +▪ `Static` `Private` `Readonly` **RETRY\_STATUS\_CODES**: `number`[] |
| 93 | + |
| 94 | +#### Defined in |
| 95 | + |
| 96 | +[algo-http-client-with-retry.ts:12](https://github.com/algorandfoundation/algokit-utils-ts/blob/4edaa90/src/algo-http-client-with-retry.ts#L12) |
| 97 | + |
| 98 | +## Methods |
| 99 | + |
| 100 | +### callWithRetry |
| 101 | + |
| 102 | +▸ `Private` **callWithRetry**(`func`): `Promise`<`BaseHTTPClientResponse`\> |
| 103 | + |
| 104 | +#### Parameters |
| 105 | + |
| 106 | +| Name | Type | |
| 107 | +| :------ | :------ | |
| 108 | +| `func` | () => `Promise`<`BaseHTTPClientResponse`\> | |
| 109 | + |
| 110 | +#### Returns |
| 111 | + |
| 112 | +`Promise`<`BaseHTTPClientResponse`\> |
| 113 | + |
| 114 | +#### Defined in |
| 115 | + |
| 116 | +[algo-http-client-with-retry.ts:25](https://github.com/algorandfoundation/algokit-utils-ts/blob/4edaa90/src/algo-http-client-with-retry.ts#L25) |
| 117 | + |
| 118 | +___ |
| 119 | + |
| 120 | +### delete |
| 121 | + |
| 122 | +▸ **delete**(`relativePath`, `data`, `query?`, `requestHeaders?`): `Promise`<`BaseHTTPClientResponse`\> |
| 123 | + |
| 124 | +#### Parameters |
| 125 | + |
| 126 | +| Name | Type | |
| 127 | +| :------ | :------ | |
| 128 | +| `relativePath` | `string` | |
| 129 | +| `data` | `Uint8Array` | |
| 130 | +| `query?` | `Query`<`string`\> | |
| 131 | +| `requestHeaders` | `Record`<`string`, `string`\> | |
| 132 | + |
| 133 | +#### Returns |
| 134 | + |
| 135 | +`Promise`<`BaseHTTPClientResponse`\> |
| 136 | + |
| 137 | +#### Overrides |
| 138 | + |
| 139 | +[URLTokenBaseHTTPClient](urlTokenBaseHTTPClient.URLTokenBaseHTTPClient.md).[delete](urlTokenBaseHTTPClient.URLTokenBaseHTTPClient.md#delete) |
| 140 | + |
| 141 | +#### Defined in |
| 142 | + |
| 143 | +[algo-http-client-with-retry.ts:67](https://github.com/algorandfoundation/algokit-utils-ts/blob/4edaa90/src/algo-http-client-with-retry.ts#L67) |
| 144 | + |
| 145 | +___ |
| 146 | + |
| 147 | +### get |
| 148 | + |
| 149 | +▸ **get**(`relativePath`, `query?`, `requestHeaders?`): `Promise`<`BaseHTTPClientResponse`\> |
| 150 | + |
| 151 | +#### Parameters |
| 152 | + |
| 153 | +| Name | Type | |
| 154 | +| :------ | :------ | |
| 155 | +| `relativePath` | `string` | |
| 156 | +| `query?` | `Query`<`string`\> | |
| 157 | +| `requestHeaders` | `Record`<`string`, `string`\> | |
| 158 | + |
| 159 | +#### Returns |
| 160 | + |
| 161 | +`Promise`<`BaseHTTPClientResponse`\> |
| 162 | + |
| 163 | +#### Overrides |
| 164 | + |
| 165 | +[URLTokenBaseHTTPClient](urlTokenBaseHTTPClient.URLTokenBaseHTTPClient.md).[get](urlTokenBaseHTTPClient.URLTokenBaseHTTPClient.md#get) |
| 166 | + |
| 167 | +#### Defined in |
| 168 | + |
| 169 | +[algo-http-client-with-retry.ts:54](https://github.com/algorandfoundation/algokit-utils-ts/blob/4edaa90/src/algo-http-client-with-retry.ts#L54) |
| 170 | + |
| 171 | +___ |
| 172 | + |
| 173 | +### post |
| 174 | + |
| 175 | +▸ **post**(`relativePath`, `data`, `query?`, `requestHeaders?`): `Promise`<`BaseHTTPClientResponse`\> |
| 176 | + |
| 177 | +#### Parameters |
| 178 | + |
| 179 | +| Name | Type | |
| 180 | +| :------ | :------ | |
| 181 | +| `relativePath` | `string` | |
| 182 | +| `data` | `Uint8Array` | |
| 183 | +| `query?` | `Query`<`string`\> | |
| 184 | +| `requestHeaders` | `Record`<`string`, `string`\> | |
| 185 | + |
| 186 | +#### Returns |
| 187 | + |
| 188 | +`Promise`<`BaseHTTPClientResponse`\> |
| 189 | + |
| 190 | +#### Overrides |
| 191 | + |
| 192 | +[URLTokenBaseHTTPClient](urlTokenBaseHTTPClient.URLTokenBaseHTTPClient.md).[post](urlTokenBaseHTTPClient.URLTokenBaseHTTPClient.md#post) |
| 193 | + |
| 194 | +#### Defined in |
| 195 | + |
| 196 | +[algo-http-client-with-retry.ts:58](https://github.com/algorandfoundation/algokit-utils-ts/blob/4edaa90/src/algo-http-client-with-retry.ts#L58) |
0 commit comments