Skip to content

Commit

Permalink
Add support to write data to api
Browse files Browse the repository at this point in the history
  • Loading branch information
NiallArkEnergy committed Jun 19, 2020
1 parent e0b2d6c commit d87a14d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Client/ClientArtesian.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@


end

function data = ExecWrite(obj, method, url, input)
headers = {'Accept' 'application/json'; 'X-Api-Key' char(obj.apiKey); 'Accept-Encoding' 'gzip'};

option = weboptions('MediaType','application/json', 'ContentType', 'auto', 'Timeout', 60, 'RequestMethod', method, 'ArrayFormat', 'csv', 'UserAgent', 'Matlab Artesian.SDK/vSuk', ...
'HeaderFields', headers);

query = obj.baseurl + url;
data = webwrite(query, jsonencode(input), option);

end

end
end
Expand Down

0 comments on commit d87a14d

Please sign in to comment.