12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package test
- import (
- "fmt"
- "io/ioutil"
- "net/http"
- "testing"
- )
- func TestName222(t *testing.T) {
- //i := 2
- //for true {
- // i -= 1
- // if i == 0 {
- // break;
- // }
- // time.Sleep(time.Millisecond * 10)
- // go gooo()
- //}
- gooo()
- //time.Sleep(time.Second * 100)
- }
- func gooo() {
- url := "https://mikaplus.xinglico.com/app/pay/payMember/10"
- method := "POST"
- client := &http.Client{}
- req, err := http.NewRequest(method, url, nil)
- if err != nil {
- fmt.Println(err)
- }
- req.Header.Add("accesskey", "b7e942a2349e455ca594f2a3e37650c2")
- res, err := client.Do(req)
- defer res.Body.Close()
- body, err := ioutil.ReadAll(res.Body)
- fmt.Println(string(body))
- }
|