posturl
posturl
VARIABLE
,
URL
,
ITEM
,
VALUE

The posturl statement loads a resource from the internet, with form data.

Parameters

This statement has four parameters:

variable – is the name of the variable into which you wish to place the downloaded resource (usually text).

url – is the address of the resource to be loaded, for example `"http://www.apple.com"`.

item – is the name of a form item expected by the server. Each name parameter must be paired with a value parameter (see below), you can have as many item/value pairs as the server calls for.

value – is the value of a form item.

Description

This statement loads a resource from the internet, with form data. In this example, two values are posted, Name and Email.

    local webPage
    posturl webPage,"http://www.somesite.com/register",
        "Name","John Smith",
        "Email","jsmith@xyzmail.com"
    displaydata webPage

This function returns whatever data the server responds with, usually HTML text.

Note: If you need more control over loading the resource, use the url( function instead.

Note: The posturl statement is synchronous. This means that Panorama stops in its tracks until the communication is complete, so you should avoid this function if possible and use urltask( instead.

See Also

- encodehttppostdata( -- converts a dictionary into HTTP post data.
- info("httpheaders") -- returns a dictionary with information about a just completed HTTP download.
- info("urltaskinfo") -- returns information about a just completed HTTP download.
- ipaddress -- returns the current IP address of the computer, or "" if not connected.
- loadurl -- loads a resource from the internet.
- loadurl( -- loads a resource from the internet.
- posturl( -- loads a resource from the internet, with form data.
- url( -- synchronously loads a resource from the internet.
- urltask( -- asynchronously loads a resource from the internet.
- urltaskcancel -- aborts a download initiated with the urltask( function.
- urltaskstatus -- enables connection error checking in urltask( completion code.
- zipinfo -- queries the web to obtain information about a zip code.
- zipinfoplus -- queries the web to obtain information about a zip code.

History

Version | Status | Notes
10.0 | Updated | Carried over from Panorama 6.0, but now can return binary data as well as text.