You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gorequest/http_test.go

28 lines
612 B

2 years ago
package gorequest
import (
2 years ago
"context"
2 years ago
"testing"
)
func TestGet(t *testing.T) {
appHttp := NewHttp()
appHttp.SetDebug()
//appHttp.SetUri("https://api.dtapp.net/ip")
2 years ago
get, err := appHttp.Get(context.Background(), "https://api.dtapp.net/ip")
2 years ago
t.Logf("get%+v\n", get)
t.Logf("get.ResponseBody%s\n", get.ResponseBody)
t.Logf("err%s\n", err)
}
func TestPost(t *testing.T) {
appHttp := NewHttp()
appHttp.SetUri("https://api.dtapp.net/ip")
2 years ago
get, err := appHttp.Post(context.Background())
2 years ago
t.Logf("get%+v\n", get)
t.Logf("get.ResponseBody%s\n", get.ResponseBody)
t.Logf("err%s\n", err)
}