Problems with http_request.get

i'm practicing this component... i use, default settings

      ...................
      - http_request.get:
          url: 'http://localip'
          on_response:
            then:
              - logger.log: 'ok'
          on_error:
            then:
              - logger.log: 'ko'
      ...................

it returns "ok", it works. if i use

      ...................
      - http_request.get:
          url: 'http://www.mydomain.com'
          on_response:
            then:
              - logger.log: 'ok'
          on_error:
            then:
              - logger.log: 'ko'
      ...................

it returns "ko" and gives an error:

[E][http_request.idf:197]: esp_http_client_open failed: ESP_ERR_HTTP_CONNECT
[E][component:405]: http_request set Error flag: unspecified

any idea?! thanks

The error message says it couldn't connect. Is the URL real?

Does the network the device is on have access to the Internet?

Does it work if you give it the IP address of the host instead of the name?

using https:// works, probably i need to change something in redirections option or there's a block server side... at the moment i need just to know what i can do, so ok

That likely means the server is saying use https only, so perhaps you should just set that.

now i have a big problem... when internet is down the board crashes and restarts, so i can't manage this situation

tryed changing connection paramenters with no success... does anyone have a working example?

thanks

edit: i increased the watchdog_timeout to 30s... keeping it too close to timeout not always works