28 "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)";
35static const char*
methods[] = {
"?",
"GET",
"HEAD",
"POST",
36 "PUT",
"DELETE",
"TRACE",
"OPTIONS",
37 "CONNECT",
"PATCH",
nullptr};
79 for (
auto& ptr :
lines){
87 if (value !=
nullptr &&
strlen(value) > 0) {
88 LOGD(
"HttpHeader::put %s %s", key, value);
92 LOGE(
"HttpHeader::put - did not add HttpHeaderLine for %s", key);
98 LOGD(
"HttpHeader::put -> '%s' : '%s'", key, value);
105 LOGI(
"- is_chunked!!!");
113 LOGD(
"HttpHeader::put - value ignored because it is null for %s", key);
120 LOGD(
"HttpHeader::put %s %d", key, value);
124 LOGW(
"value is > 1000");
130 LOGI(
"%s %s", key,
hl->value.c_str());
136 LOGD(
"HttpHeader::put -> %s", (
const char*)
line);
138 int pos =
keyStr.indexOf(
":");
139 char* key = (
char*)
line;
143 const char* value =
line + pos + 1;
144 if (value[0] ==
' ') {
145 value =
line + pos + 2;
147 return put((
const char*)key, value);
151 const char*
get(
const char* key) {
158 const char* result =
line_ptr->value.c_str();
159 return line_ptr->active ? result :
nullptr;
168 LOGD(
"HttpHeader::readLine -> %s", str);
174 LOGD(
"HttpHeader::writeHeaderLine: %s", header.
key.
c_str());
176 LOGD(
"HttpHeader::writeHeaderLine - not active");
180 LOGD(
"HttpHeader::writeHeaderLine - ignored because value is null");
217 LOGD(
"HttpHeader::read");
230 LOGI(
"Waiting for data...");
246 if (len == 0 && in.
available() == 0)
break;
262 LOGI(
"HttpHeader::write");
275 line->active =
false;
338 LOGI(
" -> %s ",
"<CR LF>");
343 if (key !=
nullptr) {
345 if (
line_ptr->key.c_str() !=
nullptr) {
346 if (
line_ptr->key.equalsIgnoreCase(key)) {
359 LOGI(
"HttpHeader::headerLine %s",
"The key must not be null");
402 LOGD(
"HttpRequestHeader::write1stLine");
423 LOGD(
"HttpRequestHeader::parse1stLine %s",
line);
449 LOGI(
"HttpReplyHeader::setValues");
459 LOGI(
"HttpReplyHeader::readExt");
470 LOGI(
"HttpReplyHeader::write1stLine");
487 LOGD(
"HttpReplyHeader::parse1stLine: %s",
line);
#define LOGW(...)
Definition AudioLoggerIDF.h:29
#define LOGI(...)
Definition AudioLoggerIDF.h:28
#define LOGD(...)
Definition AudioLoggerIDF.h:27
#define LOGE(...)
Definition AudioLoggerIDF.h:30
MethodID
supported http methods
Definition HttpTypes.h:3
@ UNDEFINED
Definition HttpTypes.h:4
#define URL_CLIENT_TIMEOUT
Definition esp8266.h:23