github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/docs/commands/getfile.md (about)

     1  # `getfile`
     2  
     3  > Makes a standard HTTP request and return the contents as Murex-aware data type for passing along Murex pipelines.
     4  
     5  ## Description
     6  
     7  Fetches a resource from a URL - setting STDOUT data-type
     8  
     9  ## Usage
    10  
    11  ```
    12  getfile url -> <stdout>
    13  ```
    14  
    15  ## Examples
    16  
    17  ```
    18  getfile google.com 
    19  ```
    20  
    21  ## Detail
    22  
    23  This simply fetches a resource (via HTTP GET request) from a URL and returns the
    24  byte stream to STDOUT. It will set STDOUT's data-type based on MIME defined in
    25  the `Content-Type` HTTP header.
    26  
    27  It is recommended that you only use this command if you're pipelining the output
    28  (eg writing to file or passing on to another function). If you just want to
    29  render the output to the terminal then use `open` which has hooks for smart
    30  terminal rendering.
    31  
    32  ### Configurable options
    33  
    34  `getfile` has a number of behavioral options which can be configured via
    35  Murex's standard `config` tool:
    36  
    37  ```
    38  config -> [ http ]
    39  ```
    40  
    41  To change a default, for example the user agent string:
    42  
    43  ```
    44  config set http user-agent "bob"
    45  getfile google.com
    46  ```
    47  
    48  This enables sane, repeatable and readable defaults. Read the documents on
    49  `config` for more details about it's usage and the rational behind the command.
    50  
    51  ## See Also
    52  
    53  * [`config`](../commands/config.md):
    54    Query or define Murex runtime settings
    55  * [`get`](../commands/get.md):
    56    Makes a standard HTTP request and returns the result as a JSON object
    57  * [`open`](../commands/open.md):
    58    Open a file with a preferred handler
    59  * [`post`](../commands/post.md):
    60    HTTP POST request with a JSON-parsable return
    61  
    62  <hr/>
    63  
    64  This document was generated from [builtins/core/httpclient/get_doc.yaml](https://github.com/lmorg/murex/blob/master/builtins/core/httpclient/get_doc.yaml).