Skip to content

How to read the request body #78

@funky-eyes

Description

@funky-eyes
  onRequestBody(body_buffer_length: usize, end_of_stream: bool): FilterDataStatusValues { 
    const contentType: String = stream_context.headers.request.get("Content-Type");
    if (contentType.toLowerCase()==="application/json") {
      const arrayBuffer: ArrayBuffer = get_buffer_bytes(BufferTypeValues.HttpRequestBody,0, end_of_stream);
      arrayBuffer
    }
    if (contentType.toLowerCase()==="application/x-www-form-urlencoded") {
      const arrayBuffer: ArrayBuffer = get_buffer_bytes(BufferTypeValues.HttpRequestBody,0, end_of_stream);
    }
    return FilterDataStatusValues.Continue;
   }

How do I convert ArrayBuffer to the corresponding data, such as map, json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions