package main import ( "fmt" "bytes" "io/ioutil" "net/http" ) func main() { url := "https://certitdev.amocrm.ru/private/api/auth.php?type=json" fmt.Println("URL:>", url) var jsonStr = []byte(`{"USER_LOGIN":"[email protected]","USER_HASH":"310b7548f578c050856fd92a59d0e73d6414ec6b"}`) req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr)) req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() fmt.Println("response Status:", resp.Status) fmt.Println("response Headers:", resp.Header) body, _ := ioutil.ReadAll(resp.Body) fmt.Println("response Body:", string(body)) }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more