var = webread(url)
var = webread(url, name1, value1, ... , nameN, valueN)
var = webread(url, name1, value1, ... , nameN, valueN, options)
| Parameter | Description |
|---|---|
| url | a string: URL to a web service. |
| name1, value1, ... , nameN, valueN | Name-Value Pair Arguments. |
| options | a weboptions object. |
| Parameter | Description |
|---|---|
| var | a variable: content from web. |
webread() reads content from the web to nelson's variable.
HTTP redirects are followed by default (see FollowLocation in weboptions).
When ContentType is 'auto' (the default), the Content-Type header of the response selects the decoder: an image/* response is read with imread, an audio/* response with audioread and a JSON response with jsondecode. Other media types are detected from the content.
url = 'https://httpbin.org/get';
res = webread(url,weboptions('ContentType','json'));
edit([modulepath('webtools'),'/examples/webread_demo_1.m'])
edit([modulepath('webtools'),'/examples/webread_demo_2.m'])
edit([modulepath('webtools'),'/examples/webread_demo_3.m'])
| Version | Description |
|---|---|
| 1.0.0 | initial version |
| 2.0.0 | redirects followed by default, 'auto' content type uses the response Content-Type header |