mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
fix(esp_http_client): updated API esp_http_client_get_url to get URL in correct format
This commit updates the API to include the port number in the URL, which was previously missing.
This commit is contained in:
@@ -1776,7 +1776,7 @@ esp_err_t esp_http_client_get_url(esp_http_client_handle_t client, char *url, co
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
if (client->connection_info.host && client->connection_info.scheme && client->connection_info.path) {
|
||||
snprintf(url, len, "%s://%s%s", client->connection_info.scheme, client->connection_info.host, client->connection_info.path);
|
||||
snprintf(url, len, "%s://%s:%d%s", client->connection_info.scheme, client->connection_info.host, client->connection_info.port, client->connection_info.path);
|
||||
return ESP_OK;
|
||||
} else {
|
||||
ESP_LOGE(TAG, "Failed to get URL");
|
||||
|
||||
Reference in New Issue
Block a user