%% Insert HTTP Header Field
% Create a request message with two header fields.

m = matlab.net.http.RequestMessage('get');
msg = addFields(m,'Accept','text/plain','Cache-Control','no-store, no-cache');

%
% Insert a Content-Type header field before the last header field in a message.

f = matlab.net.http.HeaderField('Content-Type','text/plain');
msg = addFields(msg,-1,f);
show(msg)

% Copyright 2012 The MathWorks, Inc.