9 years, 7 months ago.

HTTPClient

Hi, Just getting back to using Mbed after a break. Still a relatively new user. I'm trying to create an HTTP client to send data to thingspeak. I see there is a new EthernetInterface library which I've loaded and tested the examples successfully.

I installed the HTTPClient library and am using the code below. I'm using GET just to test it. The error message is Error: Cannot open source input file "core/fwk.h": No such file or directory in "HTTPClient/HTTPClient.cpp"

Can anyone help please. Thanks

  1. include "mbed.h"
  2. include "EthernetInterface.h"
  3. include "C12832_lcd.h"
  4. include "HTTPClient.h" C12832_LCD lcd; Serial pc(USBTX, USBRX); HTTPClient http;

int main() { EthernetInterface eth; eth.init(); Use DHCP eth.connect(); pc.printf("Hello\n\r"); lcd.cls(); lcd.locate(0,3); lcd.printf("%.2f\n",tmp.read()); lcd.printf("IP Address is %s\n\r", eth.getIPAddress()); pc.printf("IP Address is %s\n\r", eth.getIPAddress());

HTTPText txt;

HTTPResult r = http.get("http://mbed.org/media/uploads/donatien/hello.txt", &txt); if(r==HTTP_OK) { printf("Result :\"%s\"\n", txt.gets()); } else { printf("Error %d\n", r); }

eth.disconnect();

while(1) {} }

Be the first to answer this question.