1
0
mirror of https://github.com/arduino-libraries/ArduinoHttpClient.git synced 2025-04-19 21:22:15 +03:00

Merge pull request #161 from kodav/Add-443-port-for-HTTPS-requests

Add 443 port for https requests
This commit is contained in:
Andrea Gilardoni 2024-03-22 12:37:53 +01:00 committed by GitHub
commit 9ddfad1977
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -162,7 +162,7 @@ int HttpClient::sendInitialHeaders(const char* aURLPath, const char* aHttpMethod
{ {
iClient->print("Host: "); iClient->print("Host: ");
iClient->print(iServerName); iClient->print(iServerName);
if (iServerPort != kHttpPort) if (iServerPort != kHttpPort && iServerPort != kHttpsPort)
{ {
iClient->print(":"); iClient->print(":");
iClient->print(iServerPort); iClient->print(iServerPort);

View File

@ -43,6 +43,7 @@ class HttpClient : public Client
public: public:
static const int kNoContentLengthHeader =-1; static const int kNoContentLengthHeader =-1;
static const int kHttpPort =80; static const int kHttpPort =80;
static const int kHttpsPort =443;
static const char* kUserAgent; static const char* kUserAgent;
// FIXME Write longer API request, using port and user-agent, example // FIXME Write longer API request, using port and user-agent, example