Yonariel Hernandez / Mbed 2 deprecated TinyHTTPetey

Dependencies:   mbed EthernetNetIf

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "EthernetNetIf.h"
00003 #include "TCPSocket.h"
00004 #include "TinyHTTP.h"
00005 
00006 DigitalOut myled(LED1);
00007 Serial pc(USBTX, USBRX);
00008 EthernetNetIf eth;
00009 
00010 
00011 int httpRequest (int method, Host *host, char *uri, char *head, char *body);
00012 
00013 host.setName("192.168.100.204");
00014 r = httpRequest(METHOD_POST, &host, "/post.php", "Content-Type: application/x-www-form-urlencoded\r\n", "message=input by a micro-controller &submit=send");