%% Display Media Type for Message Body
% This example shows how to read the Content-Type field in a message.

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

httpsUrl = 'https://requestserver.mathworks.com';
uri = URI(strcat(httpsUrl, '/assets/computerVision.jpg'));
req = RequestMessage('GET');
response = req.send(uri);
contentTypeField = response.getFields("Content-Type");
disp(contentTypeField)

% Copyright 2020 The MathWorks, Inc.