minimal_http_post.m
% Определить URL
url = 'https://httpbin.org/post';
% Данные для отправки
data = struct('name', 'John', 'age', 30);
% Преобразовать данные в формат JSON
jsonData = jsonencode(data);
% Установить параметры запроса
options = weboptions('RequestMethod', 'post', ...
'ContentType', 'json', ...
'MediaType', 'application/json');
% Выполнить POST запрос
response = webwrite(url, jsonData, options);
% Отобразить ответ
disp(response)
Check out similar posts by category:
Matlab/Simulink
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow