HTTP/Form - Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : HTTP/Form

HTTP

 Form
 Send form data to a URL

 Calling Sequence Form(URI, formdata)

Parameters

 URI - host, port, and URL path of the form http://host:port/path/to/file; the uniform resource identifier formdata - content of the form given as a list of string=string values.

Options

 • headers=list

list of header values; duplicate values will be combined into a single comma-separated list.

 • method= a string

either "GET" or "POST". Specify whether to submit form data as a get or post request. The default is POST.

 • timeout=posint

the number of seconds to wait for data before timing out.

 • forcemode=name

either text or binary. This forces the transfer to be done in the given mode regardless of the Content-Type reported by the server.

Description

 • Form is a higher level command that accepts the form data as a list of equations, and then properly formats it as an HTTP request.

Examples

 > $\mathrm{status},\mathrm{data},\mathrm{headers}≔\mathrm{HTTP}:-\mathrm{Form}\left("http://www.ssa.gov/cgi-bin/popularnames.cgi",\left["year"=1990,"top"=20,"number"="n"\right]\right):$
 > $\mathrm{HTTP}:-\mathrm{Code}\left(\mathrm{status}\right)$
 ${"OK"}$ (1)
 > $\mathrm{type}\left(\mathrm{data},'\mathrm{string}'\right)$
 ${\mathrm{true}}$ (2)
 > ${\mathrm{data}}_{1..39}$
 ${" Popular Baby Names<"}$ (3)
 > $\mathrm{type}\left(\mathrm{headers},'\mathrm{table}'\right)$
 ${\mathrm{true}}$ (4)
 > ${\mathrm{headers}}_{"Content-Type"}$
 ${"text/html; charset=UTF-8"}$ (5)
 > $\mathrm{status},\mathrm{data},\mathrm{headers}≔\mathrm{HTTP}:-\mathrm{Form}\left("http://www.wunderground.com//history/airport/CYKF/2010/05/13/DailyHistory.html",\left[\mathrm{HideSpecis}=0,\mathrm{format}=0\right],\mathrm{method}="GET"\right):$
 > $\mathrm{HTTP}:-\mathrm{Code}\left(\mathrm{status}\right)$
 ${"OK"}$ (6)
 > $\mathrm{type}\left(\mathrm{data},'\mathrm{string}'\right)$
 ${\mathrm{true}}$ (7)
 > ${\mathrm{data}}_{1..160}$
 ${"TimeEDT,TemperatureC,Dew PointC,Humidity,Sea Level PressurehPa,VisibilityKm,Wind Direction,Wind SpeedKm/h,Gust SpeedKm/h,Precipitationmm,Events,Conditions,Wind"}$ (8)
 > $\mathrm{type}\left(\mathrm{headers},'\mathrm{table}'\right)$
 ${\mathrm{true}}$ (9)
 > ${\mathrm{headers}}_{"Connection"}$
 ${"close"}$ (10)
 > $\mathrm{status},\mathrm{data},\mathrm{headers}≔\mathrm{HTTP}:-\mathrm{Form}\left("http://chart.apis.google.com/chart",\left[\mathrm{chs}="100x100",\mathrm{cht}="qr",\mathrm{chl}="http://mapleprimes.com/"\right]\right):$
 > $\mathrm{HTTP}:-\mathrm{Code}\left(\mathrm{status}\right)$
 ${"OK"}$ (11)
 > $\mathrm{type}\left(\mathrm{data},'\mathrm{rtable}'\right)$
 ${\mathrm{true}}$ (12)
 > $\mathrm{data}$
 $\left[\begin{array}{c}{\mathrm{1 .. 648}}{\mathrm{Array}}\\ {\mathrm{Data Type:}}{{\mathrm{integer}}}_{{1}}\\ {\mathrm{Storage:}}{\mathrm{rectangular}}\\ {\mathrm{Order:}}{\mathrm{Fortran_order}}\end{array}\right]$ (13)

Compatibility

 • The HTTP[Form] command was introduced in Maple 15.
 • For more information on Maple 15 changes, see Updates in Maple 15.

 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam