diff --git a/jsonfxns.go b/jsonfxns.go index df4a16b7..baa45b65 100644 --- a/jsonfxns.go +++ b/jsonfxns.go @@ -15,6 +15,7 @@ import ( "io" "io/ioutil" "net/http" + "net/url" "strings" ) @@ -52,7 +53,7 @@ func jsonRPCSend(user string, password string, server string, message []byte, client.Transport = transport protocol = "https" } - credentials := user + ":" + password + credentials := url.UserPassword(user, password).String() resp, err := client.Post(protocol+"://"+credentials+"@"+server, "application/json", bytes.NewReader(message)) if err != nil {