我正在编写一个MATLAB模拟,将一些随机数据上传到AT& T网站M2X。
我写的代码如下:
M2XURL = 'https://api-m2x.att.com/v2/devices/xxxxxxxx1f248cabb6dc079exxxxxxxx/streams/TEMPARATURE';
writeApiKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
data =struct('TEMPARATURE',30);
options= weboptions('MediaType','application/json','contenttype','json','RequestMethod','post','KeyName','X-M2X-KEY','KeyValue',writeApiKey);
response = webwrite(M2XURL,data,options);
我得到的响应是服务器为URL返回了消息:Method Not Allowed
,
'https://api-m2x.att.com/v2/devices/1b1528cc1f248cabb6dc079e2decf176/streams/TEMPARATURE'
(HTTP响应代码405)。
是否有任何特定网址将值更新为M2X?