%% Display HTTP Date Field
% This example shows how to read the HTTP date field in a message.

import matlab.net.*;
import matlab.net.http.*;
import matlab.net.http.field.*;

httpsUrl = 'https://requestserver.mathworks.com';
uri = URI(strcat(httpsUrl, '/assets/computerVision.jpg'));
headers = DateField(datetime("today"));
req = RequestMessage('GET', headers);
response = req.send(uri);
httpDateField = response.getFields("Last-Modified");
disp(httpDateField)

% Copyright 2020 The MathWorks, Inc.