json(default_value = {}) {
        // Return from cache if available
        if (this._body_json) return Promise.resolve(this._body_json);

        // Initialize the json promise if it does not exist
        this._json_promise = new Promise((resolve, reject) =>
            this._body_parser_get_received_data().then((raw) => {
                // Decode the Uint8Array buffer into a String
                const text = this._uint8_to_string(raw);
                try {
                    // Parse the text as JSON
                    this._body_json = JSON.parse(text);
                } catch (error) {
                    if (default_value) {
                        // Use the default value if provided
                        this._body_json = default_value;
                    } else {
                        reject(error);
                    }
                }

                // Resolve the json promise with the body json
                resolve(this._body_json);
            })
        );

        // Return the json promise
        return this._json_promise;
    }
Downloads and parses the request body as a JSON object.
Passing default_value as null will lead to the function throwing an exception if invalid JSON is received.

@param {Any=} default_value Default: {}
@returns {Promise<Record>}