phs fan
/
PHSShield_test
see: https://developer.mbed.org/users/phsfan/notebook/phsshield/
Embed:
(wiki syntax)
Show/hide line numbers
TinyHTTP_a3gs.h
Go to the documentation of this file.
00001 /* 00002 * mbed Tiny HTTP Client for Ethernet Interface Library 00003 * Copyright (c) 2012 Hiroshi Suga 00004 * Released under the MIT License: http://mbed.org/license/mit 00005 */ 00006 00007 /** @file 00008 * @brief Tiny HTTP Client 00009 */ 00010 00011 #ifndef TinyHTTP_h 00012 #define TinyHTTP_h 00013 00014 #include "mbed.h" 00015 00016 #define HTTP_PORT 80 00017 #define HTTP_TIMEOUT 3000 // ms 00018 00019 #define METHOD_GET 0 00020 #define METHOD_POST 1 00021 00022 typedef void (*onHttpReceiveFunc)(char *buf, int len); 00023 00024 /** send http request 00025 * @param method METHOD_GET or METHOD_POST 00026 * @param host http server 00027 * @param uri URI 00028 * @param head http header (CR+LF) (or NULL) 00029 * @param body POST body (or NULL) 00030 * @return http code, -1:failue 00031 */ 00032 int httpRequest (int method, char *host, int port, char *uri, char *head, char *body, onHttpReceiveFunc func); 00033 00034 void createauth (char *user, char *pwd, char *buf, int len); 00035 00036 int base64enc(const char *input, unsigned int length, char *output, int len); 00037 00038 int urlencode(char *str, char *buf, int len); 00039 00040 #endif
Generated on Mon Jul 18 2022 13:29:08 by 1.7.2