For PETEY
Dependencies: mbed EthernetNetIf
main.cpp@3:e9bed024bba1, 2021-07-27 (annotated)
- Committer:
- yonaetworks
- Date:
- Tue Jul 27 01:30:17 2021 +0000
- Revision:
- 3:e9bed024bba1
- Parent:
- 2:764ecec3dc59
ko
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
okini3939 | 0:f2bf5f966801 | 1 | #include "mbed.h" |
okini3939 | 0:f2bf5f966801 | 2 | #include "EthernetNetIf.h" |
okini3939 | 0:f2bf5f966801 | 3 | #include "TCPSocket.h" |
okini3939 | 0:f2bf5f966801 | 4 | #include "TinyHTTP.h" |
okini3939 | 0:f2bf5f966801 | 5 | |
okini3939 | 0:f2bf5f966801 | 6 | DigitalOut myled(LED1); |
okini3939 | 0:f2bf5f966801 | 7 | Serial pc(USBTX, USBRX); |
okini3939 | 0:f2bf5f966801 | 8 | EthernetNetIf eth; |
okini3939 | 0:f2bf5f966801 | 9 | |
okini3939 | 2:764ecec3dc59 | 10 | |
yonaetworks | 3:e9bed024bba1 | 11 | int httpRequest (int method, Host *host, char *uri, char *head, char *body); |
okini3939 | 2:764ecec3dc59 | 12 | |
yonaetworks | 3:e9bed024bba1 | 13 | host.setName("192.168.100.204"); |
yonaetworks | 3:e9bed024bba1 | 14 | r = httpRequest(METHOD_POST, &host, "/post.php", "Content-Type: application/x-www-form-urlencoded\r\n", "message=input by a micro-controller &submit=send"); |