HTTP request to IP Address using Host header

You set the request.URL.Host to the same hostname every time and not just the request http header. You are basically changing the url on the request made for the IP address.

Also, you should check if resp.Body is nil before calling Close on it :slight_smile:

1 Like