Save content from RESTful web service to file
outfilename = websave(
saves content from the web service specified by filename
,url
)url
and
writes it to filename
. The websave
function returns the full filename
path as
outfilename
.
The web service provides a RESTful that returns data formatted as an internet media type such as JSON, XML, image, or text.
outfilename = websave(
appends
query parameters to filename
,url
,QueryName1,QueryValue1,...,QueryNameN,QueryValueN
)url
, as specified by one or
more pairs of name-value arguments. The web service defines the query
parameters.
outfilename = websave(___,
adds other HTTP request options, specified by the options
)weboptions
object options
. You can use this syntax with any of the input
arguments of the previous syntaxes.
websave
supports HTTP GET and POST methods. To send an
HTTP POST request, specify the RequestMethod
property of
options
as 'post'
. Many web services
provide both GET and POST methods to request data.
For functionality not supported by the RESTful web services functions, see the HTTP Interface.
For HTTP POST requests, the websave
function
supports only the application/x-www-form-urlencoded
media
type. To send a POST request with content of any other internet media
type, use webwrite
.