I am currently working with the net/http
package to make a request by passing the URL from the command line but what I discovered was that :
A cache is made for the request to both http/https
version of a URL I am testing with
I have tried reading about the package net/http
Do method
https://golang.org/pkg/net/http/#Client.Do
httpResponse, err := c.Do(request)
if err != nil {
fmt.Println("An error occurred from the response ", err.Error(), URL)
os.Exit(100)
}
Scenario 1:
go run web/webClient/webClient.go https://www.mtsoukalos.eu/
Result:
An error occurred from the response Get https://www.mtsoukalos.eu/: x509: certificate signed by unknown authority https://www.mtsoukalos.eu/
exit status 100
Scenario 2:
go run web/webClient/webClient.go http://www.mtsoukalo.eu/
An error occurred from the response Get https://www.mtsoukalos.eu/: x509: certificate signed by unknown authority http://www.mtsoukalos.eu/
exit status 100
The expected result of the URL in Scenario 2 should be http://www.mtsoukalos.eu/
but I still get https://www.mtsoukalos.eu/
.
Can you help me understand why it is happening this way?