URL
MultipartFormPost
multipart form post data to a specified URL
Calling Sequence
Parameters
Options
Description
Examples
References
Compatibility
MultipartFormPost( url, formdata, options )
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
cafile=string
specify a certificate file to use when authenticating the server. Maple includes a certificate file containing certificates for the major Certificate Authorities.
mode=one of text, binary, or auto
Specifies whether the reply data should be treated as a string (mode=text) or as an Array with data type integer[1] (mode=binary). When mode=auto, the data type is determined by relying on the data type provided by the server. The default is auto.
output=list or one of content, headers, or code
a list of one or more of content, headers, and code, or one of the symbols content, headers, or code. This determines what is returned by MultipartFormPost. This command returns an expression sequence with the corresponding values. The default is content.
password=string
Specify the password for authentication. This supersedes any password included in url directly.
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".
proxypassword=string
password to use for authentication against the proxy specified by the proxy option.
proxyuser=string
username to use for authentication against the proxy specified by the proxy option.
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 are returned.
timeout=posint
the number of seconds to wait before aborting the transfer. The default is infinity (in other words, no timeout).
user=string
Specify the user name for authentication. This supersedes any user name included in url directly.
verify=truefalse
Specifies whether Maple should 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.
The MultipartFormPost method sends the data specified in formdata to the URL specified in url as a multipart form post. This mimics a submit button press on a form-based web page, where all fields are sent as name=value pairs to the target web service. Use the special name=FILE(filename) option to send file data by specifying the file name rather than loading the contents of the file into a byte array.
MultipartFormPost supports two URL schemes: http and https.
The input formdata must be a list of fields of the form name=value, where name must be a string, and value' can be a string or Array with datatype integer[1], or a special name, FILE(filename), where filename is a valid file path string.
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. You can 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.
status,data,headers≔URL:-MultipartFormPost⁡https://www.ssa.gov/cgi-bin/popularnames.cgi,year=1990,top=20,number=n,timeout=100,output=code,content,headers:
RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1, W3C.
The URL[MultipartFormPost] command was introduced in Maple 2022.
For more information on Maple 2022 changes, see Updates in Maple 2022.
See Also
StringTools,Encode
URL,Construct
URL,Encode
URL,Post
Download Help Document