【发布时间】:2015-10-20 06:34:30
【问题描述】:
我想连接到 AzureML Web 服务。我已经查看了 Arduino 主页上的 POST 方法,也在这里https://iotguys.wordpress.com/2014/12/25/communicating-with-microsoft-azure-eventhub-using-arduino/
这是我的设置方法:
void setup()
{
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect.
}
Serial.println("ethernet");
if (Ethernet.begin(mac) == 0) {
Serial.println("ethernet failed");
for (;;) ;
}
// give the Ethernet shield a second to initialize:
delay(1000);
}
Post 方法基于此:http://playground.arduino.cc/Code/WebClient
我刚刚在标题中添加了sprintf(outBuf, "Authorization: Bearer %s\r\n", api_key);,char* api_key = "the ML Web Service API KEY"
另外,与 WebClient 中指定的不同,我使用整个 WebService URI 作为 url,并且不指定页面名称。
这不起作用。
我正在连接的网络可以访问 Internet。
我做错了什么?
【问题讨论】:
标签: web-services azure arduino-uno azure-machine-learning-studio