For PETEY

Dependencies:   mbed EthernetNetIf

main.cpp

Committer:
yonaetworks
Date:
2021-07-27
Revision:
3:e9bed024bba1
Parent:
2:764ecec3dc59

File content as of revision 3:e9bed024bba1:

#include "mbed.h"
#include "EthernetNetIf.h"
#include "TCPSocket.h"
#include "TinyHTTP.h"

DigitalOut myled(LED1);
Serial pc(USBTX, USBRX);
EthernetNetIf eth;


int httpRequest (int method, Host *host, char *uri, char *head, char *body);

host.setName("192.168.100.204");
r = httpRequest(METHOD_POST, &host, "/post.php", "Content-Type: application/x-www-form-urlencoded\r\n", "message=input by a micro-controller &submit=send");