* 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.
()
| 701 | * An error is thrown if the body is invalid UTF-8 data. |
| 702 | */ |
| 703 | get bodyText() { |
| 704 | try { |
| 705 | return (this.#body == null) ? "" : toUtf8String(this.#body); |
| 706 | } |
| 707 | catch (error) { |
| 708 | assert(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", { |
| 709 | operation: "bodyText", info: { response: this } |
| 710 | }); |
| 711 | } |
| 712 | } |
| 713 | /** |
| 714 | * The response body, decoded as JSON. |
| 715 | * |
nothing calls this directly
no test coverage detected