function receiveData(request, log, callback) {
    // Get keycontent
    const { parsedContentLength } = request;
    const ContentLengthThreshold = 1024 * 1024; // 1MB
    // Prevent memory overloads by limiting the size of the
    // received data.
    if (parsedContentLength > ContentLengthThreshold) {
        return callback(errorInstances.InvalidInput
            .customizeDescription(`maximum allowed content-length is ${ContentLengthThreshold} bytes`));
    }
    const value = Buffer.alloc(parsedContentLength);
    const cbOnce = jsutil.once(callback);
    const dataStream = prepareStream(request, request.streamingV4Params, log, cbOnce);
    let cursor = 0;
    let exceeded = false;
    dataStream.on('data', data => {
        if (cursor + data.length > parsedContentLength) {
            exceeded = true;
        }
        if (!exceeded) {
            data.copy(value, cursor);
        }
        cursor += data.length;
    });
    dataStream.on('end', () => {
        if (exceeded) {
            log.error('data stream exceed announced size',
                { parsedContentLength, overflow: cursor });
            return callback(errors.InternalError);
        } else {
            return callback(null, value.toString());
        }
    });
    return undefined;
}
Generic function to get data from a client request.

@param {object} request - incoming request
@param {object} log - logger object
@param {function} callback -
@returns {undefined}