URL - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Connectivity : Web Features : Web Page Access : URL package : URL/Post

URL

  

Post

  

post data to a specified URL

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

Post( url, formdata, options )

Parameters

url

-

a string specifying the destination URL for the content

formdata

-

a string, list or an Array of data type integer[1] specifying the data to be sent

Options

• 

mode=name

either text, binary, or auto.  Should the reply data be treated as a string (text) or an Array with data type integer[1] (binary). auto determines the data type by relying on the data type provided by the server.  The default is auto.  This is only supported by the http and https schemes.  ftp transfers do not return a reply.

• 

timeout=posint

the number of seconds to wait before aborting the transfer.  The default is infinity (aka no timeout).

• 

output=list

a list of one or more of content, headers, and code.  This determines what will be returned by Get.  The output will be an expression sequence with the corresponding values.  The default is [content].  This option is only valid with http and https schemes.

• 

requestheaders=list(string) or table

a list of strings and equations of strings that will be added to the http header that is sent as part of the request.

• 

responseheaders=list(string)

a list of strings specifying header fields to be returned.  This only has an effect if headers is specified in the output option.  If this option is not given, all received headers will be returned.

• 

user=string

Specify the user name for authentication. This supersedes any user name included in url directly.

• 

password=string

Specify the password for authentication. This supersedes any password included in url directly.

• 

verify=truefalse

should Maple authenticate the identity of the server by verifying its SSL certificate against a list of verified Certificate Authorities.  The default is true.  This option is only valid when using https.

• 

cafile=string

specify a certificate file to use when authenticating the server. Maple includes a certificate file containing certificates for the major Certificate Authorities.

• 

proxy=string

a URL for a proxy server. This should include the protocol, host, and port number (if not default), For example, to connect to an HTTP proxy myproxy on port 3421, use proxy=http://myproxy:3421.

• 

proxyuser=string

username to use for authentication against the proxy specified by the proxy option.

• 

proxypassword=string

password to use for authentication against the proxy specified by the proxy option.

Description

• 

The Post method sends the data specified in formdata to the url specified in url.

• 

Post currently supports three url schemes: http, https and ftp.  Not all options to Post are valid for all URL schemes.

• 

The input formdata can be a string or Array with datatype integer[1], or a list in which each element represents a form variable assignment.

• 

The requestheaders option can be used to specify HTTP header values for the outgoing post data.  This can be used to set the Content-Type for the data.

• 

The output option is a list of one or more of content, headers, and code.

content is the content returned by the URL.  One may also specify content=string where the string is a filename to which the data will be written.

headers refers to the http (and https) header received from the server.  It is not supported for urls with the ftp scheme.  It is returned as a table of strings.

code refers to the http (and https) status code returned by the server.  It is not supported for urls with the ftp scheme.  It is returned as an integer.

Examples

status,data,headersURL:-Posthttp://www.ssa.gov/cgi-bin/popularnames.cgi,year=1990&top=20&number=n,timeout=100,output=code,content,headers:

typedata,string

true

(1)

data1..6

typeheaders,table

true

(2)

indicesheaders,nolist

Content-type,Server,Transfer-encoding,Cache-control,Date

(3)

headersContent-type

text/html

(4)

Connect to ssa.gov using proxy server http://myproxy on port 3421 with specified proxy user credentials.

URL:-Gethttp://www.ssa.gov/cgi-bin/popularnames.cgi,year=1990&top=20&number=n,proxy=http://myproxy:3421,proxyuser=graymond,proxypassword=maple

Compatibility

• 

The URL[Post] command was introduced in Maple 18.

• 

For more information on Maple 18 changes, see Updates in Maple 18.

See Also

StringTools,Encode

URL

URL,Construct

URL,Encode

URL,Post

 


Download Help Document

Was this information helpful?



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