matlab.net.http.field.SetCookieField class

Package: matlab.net.http.field
Superclasses: matlab.net.http.HeaderField

HTTP Set-Cookie header field

Description

A SetCookieField object appears in a response message created by the server. A message can have one or more Set-Cookie fields. To extract the Value property as a CookieInfo object, call the convert method.

Properties

expand all

Header field name, specified as 'Set-Cookie'.

Header field value, specified as a string.

Methods

convertReturns CookieInfo object for each Set-Cookie field

Attributes

Sealedtrue

Examples

expand all

uri = matlab.net.URI('http://www.mathworks.com');
opts = matlab.net.http.HTTPOptions('MaxRedirects',1);
resp = matlab.net.http.RequestMessage().send(uri,opts);
setCookieFields = resp.getFields('Set-Cookie');
if ~isempty(setCookieFields)
   cookieInfos = setCookieFields.convert(uri);
end

Introduced in R2016b

Was this topic helpful?