auth_sip_user func(user string,profile string) (crm ) {
var data crm
crm_st := "xxxxx"
client := &http.Client{}
req, _ := http.NewRequest("GET", ""+crm_st"+", nil)
req.Header.Add("Accept", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
resp_body, _ := ioutil.ReadAll(resp.Body)
byt := []byte(resp_body)
var dat map[string]interface{}
if err := json.Unmarshal(byt, &dat); err != nil {
fmt.Println("JSON-ERR")
}
bytes := []byte(resp_body)
json.Unmarshal(bytes, &data)
fmt.Println("SIP:",data.sip)
st := string(resp_body)
fmt.Println("STATUS",resp.StatusCode,"user",user,"ST",st,"DAT",data.sip)
return data
}
type crm struct {
Sip string `json:"sip"`
}
Find more questions by tags Go