%% Write JSON Object
% This example shows how to write a record as a JSON object.

httpsUrl = 'https://requestserver.mathworks.com';
employee(1).Name = 'Jon';
employee(1).Occupation = 'Doctor';
employee(2).Name = 'Sarah';
employee(2).Occupation = 'Engineer';
options = weboptions('MediaType', 'application/json');
responseEmployee = webwrite(httpsUrl, employee, options)

% Copyright 2020 The MathWorks, Inc.