Page 1 of 1

Permanent error with esp_http_client

Posted: Tue Aug 20, 2019 12:09 pm
by ukrsms
I do not have any idea why it was made in this way, therefore, it looks like a bug in the following code:
In function static esp_err_t esp_http_check_response(esp_http_client_handle_t client):

Code: Select all

if (client->redirect_counter >= client->max_redirection_count || client->disable_auto_redirect) {
        ESP_LOGE(TAG, "Error, reach max_redirection_count count=%d", client->redirect_counter);
        return ESP_ERR_HTTP_MAX_REDIRECT;
    }
I do not need auto redirection, so I set disable_auto_redirect=1 and max_redirection_count is equal to 0 by default. As a result any time I have valid response without redirection I get error ESP_ERR_HTTP_MAX_REDIRECT.
Could anyone tell me is this a bug or did I lost something?

Re: Permanent error with esp_http_client

Posted: Wed Aug 21, 2019 4:58 am
by chegewara
Are you sure that URL you are trying to reach is not returning with HTTP 3xx code?

Re: Permanent error with esp_http_client

Posted: Wed Aug 21, 2019 8:11 am
by ukrsms
Yes, the site I requested does reply with 3xx code? So, did this mean it is OK that I get an error?
The matter is that I just need to perform this request in order to get the location for further requests - I do not need automatic redirection. So, I expect to get a location string with no error because I specified in the settings that automatic redirection should be disabled.