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 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.
Examples
Input Arguments
More About
Tips
For functionality not supported by the RESTful web services functions, see the Use HTTP with MATLAB.
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
.To specify proxy server settings, see Proxy Server Authentication.
Version History
Introduced in R2014b