Neodymium Plated Magnet

    httpyac-plugin-yaml-body

    0.2.4 • Public • Published

    httpyac-plugin-yaml-body

    HttpYac plugin to enable yaml notation for sending JSON request bodies. Pure syntactic sugar!

    build

    Installation

    npm install httpyac-plugin-yaml-body --save
    

    Usage

    Plugin adds syntactic sugar to ease dealing with JSON bodies. With the plugin, the body can be in yaml format, which will be converted to JSON before the request is send. The correct Content-Type application/json will be set too, if not yet provided. Ensure the first body line contains the yaml header to detect the format. Example:

    POST http://localhost:8080
    ---
    id: 1
    

    gets translated to

    POST http://localhost:8080
    Content-Type: application/json
    {
      "id": 1
    }
    

    Enforce yaml

    In case of a Content-Type header is present, no converstion happens, even if body is yaml.

    Install

    npm i httpyac-plugin-yaml-body

    DownloadsWeekly Downloads

    2

    Version

    0.2.4

    License

    ISC

    Unpacked Size

    16.1 kB

    Total Files

    12

    Last publish

    Collaborators

    • rngtng