murex Shell Docs

Command Reference: post

HTTP POST request with a JSON-parsable return

Description

Fetches a page from a URL via HTTP/S POST request.

Usage

post url -> <stdout>

<stdin> -> post url content-type -> <stdout>

Examples

» post google.com -> [ Status ] 
{
    "Code": 405,
    "Message": "Method Not Allowed"
}

Detail

JSON return

POST returns a JSON object with the following fields:

{
    "Status": {
        "Code": integer,
        "Message": string,
    },
    "Headers": {
        string [
            string...
        ]
    },
    "Body": string
}

The concept behind this is it provides and easier path for scripting eg pulling specific fields via the index, [, function.

post as a method

Running post as a method will transmit the contents of STDIN as part of the body of the HTTP POST request. When run as a method you have to include a second parameter specifying the Content-Type MIME.

Configurable options

post has a number of behavioral options which can be configured via murex's standard config tool:

config: -> [ http ]

To change a default, for example the user agent string:

config: set http user-agent "bob"
post: google.com

This enables sane, repeatable and readable defaults. Read the documents on config for more details about it's usage and the rational behind the command.

See Also

This site is rebuilt weekly, the content is automatically generated from murex's source code. Last built on Mon Aug 3 06:12:53 UTC 2020 against commit 2557f7c2557f7cc7535c452c21d89164bd38ed8996f02fd. Downloadable murex binaries are also built weekly. Current version is 0.52.2000 BETA which has been verified against tests.