有's a good example on the Arduino website that shows exactly how to do this. Essentially you' ll调用 client.connect("www.xxx.xxx", 80) ,其中 client 是 EthernetClient 类的对象,然后使用 client.println() 发送GET请求 . 您实际上将自己发送HTTP标头和数据,但此页面将向您展示如何在“代码”部分中执行此操作:https://www.arduino.cc/en/Tutorial/WebClient .
2 回答
只需发送GET . 例如,
www.yourwebsite.com/arduinoreader.php?sensor=on
.有's a good example on the Arduino website that shows exactly how to do this. Essentially you' ll调用
client.connect("www.xxx.xxx", 80)
,其中client
是EthernetClient
类的对象,然后使用client.println()
发送GET请求 . 您实际上将自己发送HTTP标头和数据,但此页面将向您展示如何在“代码”部分中执行此操作:https://www.arduino.cc/en/Tutorial/WebClient .在该示例中,您可以使用以下内容替换
client.println("GET /search?q=arduino HTTP/1.1");
: