Http.get

From MiniScript Wiki
Jump to navigation Jump to search

In Mini Micro, the http.get function returns the contents of a URL using the HTTP protocol. It supports text, images, sounds, and raw binary data.

Arguments

Parameter Name Meaning
url URL of the web page or resource to fetch
headers optional map of HTTP headers

Usage Notes

The type of the value returned depends on the MIME type reported by the server, as follows:

MIME Type MiniScript Type
image Image object
audio Sound object
text, javascript, xml, or json string
any other type RawData object

Example

The following example, typed on the Mini Micro command line, retrieves and displays Minnie from the MiniScript web site.

view http.get("https://miniscript.org/img/Icon.png")