* The response body as a UTF-8 encoded string, or the empty * string (i.e. ``""``) if there was no body. * * An error is thrown if the body is invalid UTF-8 data.
()
| 810 | * An error is thrown if the body is invalid UTF-8 data. |
| 811 | */ |
| 812 | get bodyText(): string { |
| 813 | try { |
| 814 | return (this.#body == null) ? "": toUtf8String(this.#body); |
| 815 | } catch (error) { |
| 816 | assert(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", { |
| 817 | operation: "bodyText", info: { response: this } |
| 818 | }); |
| 819 | } |
| 820 | } |
| 821 | |
| 822 | /** |
| 823 | * The response body, decoded as JSON. |
nothing calls this directly
no test coverage detected