You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
732 B
18 lines
732 B
2 years ago
|
function update_descriptions(table)
|
||
|
props = table.Properties;
|
||
|
json = jsonencode(struct( ...
|
||
|
'units', cell2struct(props.VariableUnits, props.VariableNames, 2), ...
|
||
|
'descriptions', cell2struct(props.VariableDescriptions, props.VariableNames, 2)));
|
||
|
|
||
|
import matlab.net.http.*
|
||
|
import matlab.net.http.io.*
|
||
|
req = RequestMessage('put', HeaderField('Auth', 'Qnb7jfeGZM'), StringProvider(json));
|
||
|
url = 'https://driver-observer.thi.de/update_descriptions.php';
|
||
|
res = req.send(url);
|
||
|
|
||
|
if res.StatusCode ~= StatusCode.OK
|
||
|
throw(MException('update_descriptions:http_error', ...
|
||
|
'HTTP Error %s (%s); Body: %s', string(res.StatusCode), ...
|
||
|
string(getReasonPhrase(res.StatusCode)), res.Body.Data));
|
||
|
end
|
||
|
end
|