Skip to content

weboptions

web · scripts/web/weboptions.m

: opts = weboptions ()
: opts = weboptions (name, value, …)

Create a set of options for HTTP requests made by webread, webwrite and websave.

The properties are CharacterEncoding, UserAgent, Timeout, Username, Password, BasicAuthenticationMethod, KeyName, KeyValue, HeaderFields, ContentType, ContentReader, MediaType, RequestMethod, ArrayFormat and CertificateFilename. Property names are not case sensitive in the constructor and every assignment is validated.

Username/Password supply Basic HTTP authentication. BasicAuthenticationMethod is "challenge" (default) or "preemptive" (R2026a). A Bearer token is supplied with HeaderFields as @{"Authorization", ["Bearer " token]}}.