httputil_test.go 904 B

12345678910111213141516171819202122232425262728293031
  1. package utils
  2. //type WhilteListMsg struct {
  3. // Code string `json:"code"`
  4. // Message string `json:"msg"`
  5. // Data []interface{} `json:"data"`
  6. //}
  7. //
  8. //type WhiteListParam struct {
  9. // HostID string `json:"host_id"`
  10. // AccountID int32 `json:"account_id"`
  11. //}
  12. // func TestGetWhiteList(t *testing.T) {
  13. //param := WhiteListParam{HostID: "1618154815414545", AccountID: 110}
  14. //paramByte, err := json.Marshal(param)
  15. //if err != nil {
  16. // // log.Errorf("agent[cdc] get runner status error:%s ", err)
  17. // // continue
  18. //}
  19. //resp, err := utils.HTTPConnect("POST", "http://10.0.12.192:18080/api/v1/agent/whitelist", "", paramByte)
  20. //if err != nil {
  21. // // log.Errorf("agent[cdc] get runner status error:%s ", err)
  22. //}
  23. //result := WhilteListMsg{}
  24. //err = json.Unmarshal(resp, &result)
  25. //if err != nil {
  26. // // log.Errorf("agent[cdc] get runner status error:%s", err)
  27. //}
  28. //fmt.Println(result)
  29. // }