mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'fix/add_code_to_print_buffer' into 'master'
fix: Add code to print the response buffer See merge request espressif/esp-idf!30911
This commit is contained in:
commit
a36eb589a6
@ -4,4 +4,9 @@ menu "Example Configuration"
|
|||||||
default "httpbin.org"
|
default "httpbin.org"
|
||||||
help
|
help
|
||||||
Target endpoint host-name for the example to use.
|
Target endpoint host-name for the example to use.
|
||||||
|
config EXAMPLE_ENABLE_RESPONSE_BUFFER_DUMP
|
||||||
|
bool "Enable logging response buffer from HTTP event handler"
|
||||||
|
default false
|
||||||
|
help
|
||||||
|
HTTP response is accumulated in output_buffer. Enable this config to print the accumulated response
|
||||||
endmenu
|
endmenu
|
||||||
|
@ -108,7 +108,9 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
|
|||||||
case HTTP_EVENT_ON_FINISH:
|
case HTTP_EVENT_ON_FINISH:
|
||||||
ESP_LOGD(TAG, "HTTP_EVENT_ON_FINISH");
|
ESP_LOGD(TAG, "HTTP_EVENT_ON_FINISH");
|
||||||
if (output_buffer != NULL) {
|
if (output_buffer != NULL) {
|
||||||
// Response is accumulated in output_buffer. Uncomment the below line to print the accumulated response
|
#if CONFIG_EXAMPLE_ENABLE_RESPONSE_BUFFER_DUMP
|
||||||
|
ESP_LOG_BUFFER_HEX(TAG, output_buffer, output_len);
|
||||||
|
#endif
|
||||||
free(output_buffer);
|
free(output_buffer);
|
||||||
output_buffer = NULL;
|
output_buffer = NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user