deom_test.go 668 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package test
  2. import (
  3. "fmt"
  4. "io/ioutil"
  5. "net/http"
  6. "testing"
  7. )
  8. func TestName222(t *testing.T) {
  9. //i := 2
  10. //for true {
  11. // i -= 1
  12. // if i == 0 {
  13. // break;
  14. // }
  15. // time.Sleep(time.Millisecond * 10)
  16. // go gooo()
  17. //}
  18. gooo()
  19. //time.Sleep(time.Second * 100)
  20. }
  21. func gooo() {
  22. url := "https://mikaplus.xinglico.com/app/pay/payMember/10"
  23. method := "POST"
  24. client := &http.Client{}
  25. req, err := http.NewRequest(method, url, nil)
  26. if err != nil {
  27. fmt.Println(err)
  28. }
  29. req.Header.Add("accesskey", "b7e942a2349e455ca594f2a3e37650c2")
  30. res, err := client.Do(req)
  31. defer res.Body.Close()
  32. body, err := ioutil.ReadAll(res.Body)
  33. fmt.Println(string(body))
  34. }