package api import ( "bytes" "io/ioutil" "net/http" ) func HttpTest() (string, error) { jsonDataStr := ` { "auth": { "auth": "9d8b7074bf189dcad17189c8f264c0cb", "timestamp": "123123" } } ` jsonData := []byte(jsonDataStr) resp, err := http.Post("http://web.410eth.com:8888", "application/json", bytes.NewBuffer(jsonData)) if err != nil { return "", err } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { return "", err } return string(body), nil }