[HTTP] Replaced itoa() with sprintf()
This commit is contained in:
parent
271f5bd62c
commit
6f0989993e
1 changed files with 2 additions and 2 deletions
|
@ -140,8 +140,8 @@ int16_t HTTPClient::post(const char* url, const char* content, String& response,
|
||||||
}
|
}
|
||||||
|
|
||||||
// build the POST request
|
// build the POST request
|
||||||
char contentLengthStr[8];
|
char contentLengthStr[12];
|
||||||
itoa(strlen(content), contentLengthStr, 10);
|
sprintf(contentLengthStr, "%d", strlen(content));
|
||||||
char* request = new char[strlen(endpoint) + strlen(host) + strlen(contentType) + strlen(contentLengthStr) + strlen(content) + 64 + 1];
|
char* request = new char[strlen(endpoint) + strlen(host) + strlen(contentType) + strlen(contentLengthStr) + strlen(content) + 64 + 1];
|
||||||
strcpy(request, "POST ");
|
strcpy(request, "POST ");
|
||||||
strcat(request, endpoint);
|
strcat(request, endpoint);
|
||||||
|
|
Loading…
Add table
Reference in a new issue