I'm trying to make a simple HTTP request in Go, after directly following the guides I keep getting the same error:
local error: tls: no renegotiation
I don't quite understand how to interpret this? I know it's not an issue on the server as when I call the same request from python it returns fine. Here's my code:
package main
import (
"fmt"
"net/http"
"net/url"
"strings"
"time"
)
func main() {
timeout := time.Duration(20 * time.Second)
client := &http.Client{
Timeout: timeout,
}
data := url.Values{
"top": {"10"},
"lDate": {"2019-01-01"},
}
req, err := http.NewRequest("POST", "https://api.*********.com/AppAvailLoads?", strings.NewReader(data.Encode()))
if err != nil {
fmt.Println("Error in construction")
}
req.Header.Add("x-cdata-authtoken", "********")
req.Header.Add("content-type", "application/x-www-form-urlencoded")
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error in request")
fmt.Println(err)
} else {
fmt.Println(resp.Body)
resp.Body.Close()
}
}