matlab.net.http.AuthInfo Class
Namespace: matlab.net.http
Authentication or authorization information in HTTP messages
Description
MATLAB® automatically handles authentication in request messages when you provide
credentials in an HTTPOptions
object. Use the AuthInfo
class to
examine authentication, to specify authorization information, or to implement an
authentication protocol, such as OAuth
, that is not handled
automatically by the MATLAB HTTP interface.
The AuthInfo
class represents one authentication challenge returned
when:
You call the
AuthenticateField.convert
method for a response message.You insert credentials in an
AuthorizationField
header field into a request message. When you store anAuthInfo
object in an Authorization field, MATLAB automatically encloses values in quotes where required, and inserts escape characters as needed.A server returns
auth-info
data in anAuthenticationInfoField
header field.
The AuthenticateField
and AuthorizationField
convert
methods convert each name=value
pair attribute in
the field to parameter name-and-value pairs in the Parameters
property.
Escape characters and any quotes surrounding values are removed.
For more information, see RFC 7235 Authentication and RFC 2617 Host-Imp Interface (for Basic and Digest authentication) on the RFC Editor website.
Creation
Description
obj = matlab.net.http.AuthInfo(Scheme,
creates an paramName
,paramValue
)AuthInfo
object that includes the Scheme property and optional
paramName
,paramValue
parameters. You can
specify several argument pairs in any order as
paramName1,paramValue1,...,paramNameN,paramValueN
.
obj = matlab.net.http.AuthInfo(
creates an paramName
,paramValue
)AuthInfo
object with an empty Scheme
value.
obj = matlab.net.http.AuthInfo(
copies parameters and values from the fields of pStruct
)pStruct
.
obj = matlab.net.http.AuthInfo(
creates
an pStr
)AuthInfo
from pStr
.
Input Arguments
Properties
Methods
Version History
Introduced in R2016b