I'm working with esp 32 and I'm try to reproduce the http_request _example form esp-idf and I'm with some trouble in this peace of code:
Code: Select all
#define WEB_SERVER "example.com"
.
.
.
struct addrinfo *res;
struct addrinfo hints = {
.ai_family = AF_INET,
.ai_socktype = SOCK_STREAM,
};
int result = getaddrinfo(WEB_SERVER , "80", &hints, &res);
if((result != 0) || (res == NULL))
{
ESP_LOGE(log_string, "DNS lookup failed err=%d res=%p", result, res);
}
DNS lookup failed err=202 res=0x0
Someone knows how to solve this problem?