Updated the HttpClient class due to changes to the httpVersionToString and httpMIMETypeToString methods

This commit is contained in:
anschrammh 2022-04-05 21:00:50 +02:00
parent 4c7fc2ea2a
commit 847b350f82

View File

@ -356,17 +356,16 @@ void HttpClient::keepAlive(boolean enabled)
void HttpClient::sendHeader(HttpMIMEType contentType, uint64_t contentLength, Dictionary<DictionaryHelper::StringEntity> *headerData, HttpVersion httpVersion) void HttpClient::sendHeader(HttpMIMEType contentType, uint64_t contentLength, Dictionary<DictionaryHelper::StringEntity> *headerData, HttpVersion httpVersion)
{ {
char mime[255] = "", httpVer[15] = "";
//Host could be an IP address or a host name //Host could be an IP address or a host name
if(_isIp) if(_isIp)
printf(" %s\r\nHost: %u.%u.%u.%u:%u\r\nConnection: %s\r\n", httpVersionToString(httpVersion, httpVer), remoteIP()[0], remoteIP()[1], remoteIP()[2], remoteIP()[3], remotePort(), _keepAlive ? "keep-alive" : "close"); printf(" %s\r\nHost: %u.%u.%u.%u:%u\r\nConnection: %s\r\n", httpVersionToString(httpVersion), remoteIP()[0], remoteIP()[1], remoteIP()[2], remoteIP()[3], remotePort(), _keepAlive ? "keep-alive" : "close");
else else
printf(" %s\r\nHost: %s\r\nConnection: %s\r\n", httpVersionToString(httpVersion, httpVer), _pAddress, _keepAlive ? "keep-alive" : "close"); printf(" %s\r\nHost: %s\r\nConnection: %s\r\n", httpVersionToString(httpVersion), _pAddress, _keepAlive ? "keep-alive" : "close");
if(contentLength > 0) if(contentLength > 0)
{ {
printf("Content-Length: %llu\r\n", contentLength); printf("Content-Length: %llu\r\n", contentLength);
printf("Content-Type: %s\r\n", httpMIMETypeToString(contentType, mime)); printf("Content-Type: %s\r\n", httpMIMETypeToString(contentType));
} }
//We send the headerData if not NULL //We send the headerData if not NULL