websave
Save content from RESTful web service to file
Syntax
Description
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 interface 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 parameter names and values. The web service defines the query
parameters.
outfilename = websave(___,
adds other HTTP request options, specified by the options
)weboptions
object options
. You can specify this argument in addition to
any of the input argument combinations in 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.
Examples
Input Arguments
More About
Tips
For functionality not supported by the RESTful web services functions, see Call Web Services from MATLAB Using HTTP.
The web services APIs only support HTTP 1.1.
For HTTP POST requests, the
websave
function supports only theapplication/x-www-form-urlencoded
media type. To send a POST request with content of any other internet media type, usewebwrite
.For information on how to specify proxy server settings, see Proxy Server Authentication.