From MiniScript Wiki
Jump to navigation Jump to search

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


Parameter Name Meaning
url URL of the web page or resource to fetch
data Data to post can be a string or a map
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


The following example, typed on the Mini Micro command line posts form data, retrieves a response, and displays Hello World from the test site

import "json"
request ="", {"data":"Hello World"})
request_data = json.parse(request)