void
begin
(const char *url, const char *httpsFingerprint="")
void
begin
(String url, String httpsFingerprint="")
void
begin
(const char *host, uint16_t port, const char *url="/", bool https=false, const char *httpsFingerprint="")
void
begin
(String host, uint16_t port, String url="/", bool https=false, String httpsFingerprint="")
void
end
(void)
bool
connected
(void)
void
setReuse
(bool reuse)
void
setUserAgent
(const char *userAgent)
keep-alive
More...
void
setAuthorization
(const char *user, const char *password)
void
setAuthorization
(const char *auth)
void
setTimeout
(uint16_t timeout)
int
GET
()
request handling
More...
int
POST
(uint8_t *payload, size_t size)
int
POST
(String payload)
int
sendRequest
(const char *type, uint8_t *payload=NULL, size_t size=0)
int
sendRequest
(const char *type,
Stream
*stream, size_t size=0)
void
addHeader
(const String &name, const String &value, bool first=false)
void
collectHeaders
(const char *headerKeys[], const size_t headerKeysCount)
Response handling.
More...
String
header
(const char *name)
String
header
(size_t i)
String
headerName
(size_t i)
int
headers
()
bool
hasHeader
(const char *name)
int
getSize
(void)
WiFiClient
&
getStream
(void) __attribute__((deprecated))
WiFiClient
*
getStreamPtr
(void)
int
writeToStream
(
Stream
*stream)
String
getString
(void)
Static Public Member Functions
static String
errorToString
(int error)
Protected Member Functions
bool
connect
(void)
bool
sendHeader
(const char *type)
int
handleHeaderResponse
()
Protected Attributes
WiFiClient
*
_tcp
WiFiClientSecure
*
_tcps
String
_host
request handling
More...
uint16_t
_port
bool
_reuse
uint16_t
_tcpTimeout
String
_url
bool
_https
String
_httpsFingerprint
String
_Headers
String
_userAgent
String
_base64Authorization
RequestArgument
*
_currentHeaders
Response handling.
More...
size_t
_headerKeysCount
int
_returnCode
int
_size
bool
_canReuse
ESP8266HTTPClient.cpp
Created on: 02.11.2015
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA constractor
typeconst char * "GET", "POST", ....
payloaduint8_t * data for the message body if null not send
sizesize_t size for the message body if 0 not send
-
Returns
-
-1 if no info or > 0 when Content-Length is set by server