我想连接到AzureML Web服务。我已经调查的Arduino的首页POST方法和这里https://iotguys.wordpress.com/2014/12/25/communicating-with-microsoft-azure-eventhub-using-arduino/Arduino Uno - WebService(AzureML)
这里是我的设置方法:
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访问权限。
我在做什么错?