Documentation
    Preparing search index...

    Function PlainBody

    Registers the transformed text assertion and binds its successful value. The public overload accepts no runtime assertion; the transform supplies it.

    • Plain body decorator.

      PlainBody is a decorator function getting full body text from the HTTP request. The transformed assertion's successful string is the decorated argument.

      If you adjust the regular Body decorator function to the body parameter, you can't get the full body text because the Body tries to convert the body text to JSON object. Therefore, @nestia/core provides this PlainBody decorator function to get the full body text.

      \@TypedRoute.Post("memo")
      public store
      (
      \@PlainBody() body: string
      ): void;

      Returns ParameterDecorator

      Parameter decorator

      Jeongho Nam - https://github.com/samchon

      contracts/common.md#principled-implementation The decorator reads text only for text/plain requests; an installed assertion resolves the argument value through the shared body checker, while no assertion retains raw text. Absent input is accepted when its assertion accepts undefined and otherwise continues through the media-type error path.

      contracts/common.md#clear-and-simple-design One parameter decorator shares body absence, media recognition, text reading and successful-value resolution with the other request decorators.

      contracts/common.md#prohibited-implementation-shortcuts Text comes from the request parser or shared raw-body reader, not a fabricated value; no runtime controller or body identity is special-cased.

      contracts/common.md#meaningful-documentation The comment distinguishes full body text from JSON parsing and states that the transformed assertion supplies the argument.

      contracts/portability.md#os-neutral-implementation HTTP text bodies and decoded string values carry no native filesystem or subprocess boundary.