FUNCTION REFERENCE
weboptions
Settings for webread and websave.
Settings for webread and websave.
Syntax
options = weboptionsSyntax
options = weboptions(name1, value1, ...)Returns a struct with the fields CharacterEncoding ('auto': from the response, else UTF-8), UserAgent ('MatRust/<version>'), Timeout (seconds, default 5), ContentType ('auto', 'text', 'json', 'binary' or 'raw') and HeaderFields (an n-by-2 cell array of extra request header names and values). Change a field with dot assignment or give name/value pairs.
Example
options = weboptions('Timeout', 30, 'HeaderFields', {'Accept', 'application/json'})Differences from MATLAB: options is a struct, not a weboptions object. Username, Password, KeyName, KeyValue and CertificateFilename are errors; MediaType, ArrayFormat and ContentReader are accepted and ignored; RequestMethod can only be 'get'.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.