| 272 | |
| 273 | private textBody?: Effect.Effect<string, Error.HttpClientError> |
| 274 | get text(): Effect.Effect<string, Error.HttpClientError> { |
| 275 | if (this.textBody) { |
| 276 | return this.textBody |
| 277 | } |
| 278 | this.textBody = Effect.tryPromise({ |
| 279 | try: () => this.source.body.text(), |
| 280 | catch: (cause) => |
| 281 | new Error.HttpClientError({ |
| 282 | reason: new Error.DecodeError({ |
| 283 | request: this.request, |
| 284 | response: this, |
| 285 | cause |
| 286 | }) |
| 287 | }) |
| 288 | }).pipe(Effect.cached, Effect.runSync) |
| 289 | this.arrayBufferBody = Effect.map(this.textBody, (_) => new TextEncoder().encode(_).buffer) |
| 290 | return this.textBody |
| 291 | } |
| 292 | |
| 293 | get urlParamsBody(): Effect.Effect<UrlParams.UrlParams, Error.HttpClientError> { |
| 294 | return Effect.flatMap(this.text, (_) => |