%% Specify Media Content Type
% This example shows how a client specifies media type image/jpeg for reading an image.

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

httpUrl  = 'http://requestserver.mathworks.com';
uri = URI(strcat(httpUrl, '/assets/computerVision.jpg'));
headers = AcceptField(MediaType('image/jpeg')); 
req = RequestMessage('GET', headers);
[~, completedReq, ~] = req.send(uri);
show(completedReq, 0)

% Copyright 2020 The MathWorks, Inc.