<< repo Web tools webread >>

weboptions


Specify parameters for RESTful web service


Syntax


options = weboptions()
options = weboptions(name, value)

Input argument


name

a string.

value

a variable: value corresponding to name field.

Output argument


options

a weboptions object.

Description


options = weboptions() returns default weboptions object.

weboptions object can be an optional input argument to the webread, websave, and webwrite builtin.

Name-Value Pair Arguments:

UserAgent User agent identification: a string or character vector.

Timeout Time out connection duration: positive numeric scalar or Inf value.

Username User identifier: a string or character vector.

Password User authentication password: a string or character vector.

KeyName Name of key: a string or character vector.

KeyValue Value of key: a string scalar, character vector, numeric or logical.

HeaderFields Names and values of header fields: m-by-2 array of strings or cell array of character vectors

ContentType Content type: a string scalar or character vector.

supported value: 'auto', 'text', 'audio', 'binary', 'json', 'raw'

ContentReader Content reader: an function handle.

MediaType Media type: a string or character vector.

supported value: 'auto', 'application/x-www-form-urlencoded'

RequestMethod HTTP request method: a string or character vector.

supported value: 'auto', 'get', 'post', 'put', 'delete', 'patch'

ArrayFormat: 'csv' (default), 'json', 'repeating' or 'php'

CertificateFilename Filename of root certificates: a string or character vector.

FollowLocation tells the library to follow any Location: header redirect that an HTTP server sends in a 30x response: a logical, false by default.

Example


weboptions()
options = weboptions('UserAgent', 'http://www.whoishostingthis.com/tools/user-agent/')

See also


webread, websave.

History


Version Description
1.0.0 initial version
1.6.0 'FollowLocation' option added

Author


Allan CORNET

<< repo Web tools webread >>