- DocumentID: get
  Title: >+
    `get`
  CategoryID: commands
  Summary: >-
    Makes a standard HTTP request and returns the result as a JSON object
  Description: |-
    Fetches a page from a URL via HTTP/S GET request
  Usage: |-
    ```
    get url -> <stdout>

    <stdin> -> get url -> <stdout>
    ```
  Examples: |-
    ```
    » get google.com -> [ Status ]
    {
        "Code": 200,
        "Message": "OK"
    }
    ```
  Detail: |-
    ### JSON return

    `get` 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.

    ### `get` as a method

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

    ### Configurable options

    `get` 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"
    get: 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.
  Synonyms:
  Related:
  - post
  - index
  - element
  - getfile
  - config



- DocumentID: getfile
  Title: >+
    `getfile`
  CategoryID: commands
  Summary: >-
    Makes a standard HTTP request and return the contents as Murex-aware data type
    for passing along Murex pipelines.
  Description: |-
    Fetches a resource from a URL - setting STDOUT data-type
  Usage: |-
    ```
    getfile url -> <stdout>
    ```
  Examples: |-
    ```
    getfile google.com 
    ```
  Detail: |-
    This simply fetches a resource (via HTTP GET request) from a URL and returns the
    byte stream to STDOUT. It will set STDOUT's data-type based on MIME defined in
    the `Content-Type` HTTP header.

    It is recommended that you only use this command if you're pipelining the output
    (eg writing to file or passing on to another function). If you just want to
    render the output to the terminal then use `open` which has hooks for smart
    terminal rendering.

    ### Configurable options

    `getfile` 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"
    getfile: 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.
  Synonyms:
  Related:
  - get
  - post
  - open
  - config
