MATLAB minimal HTTP POST request example
% Define the URL
url = 'https://httpbin.org/post';
% Data to send
data = struct('name', 'John', 'age', 30);
% Convert data to JSON format
jsonData = jsonencode(data);
% Set request options
options = weboptions('RequestMethod', 'post', ...
'ContentType', 'json', ...
'MediaType', 'application/json');
% Make the POST request
response = webwrite(url, jsonData, options);
% Display the response
disp(response)
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow