mh_server/lib/requests/requests_test.go
2021-06-30 10:12:05 +08:00

33 lines
483 B
Go

package requests
import (
"testing"
)
func TestGet(t *testing.T) {
resp, err := Get("http://127.0.0.1:5000/h?cc=gg", map[string]string{
"aaa": "bbb",
"ccc": "ddd",
})
if err != nil {
t.Error(err)
return
}
t.Log(string(resp))
return
}
func TestPost(t *testing.T) {
resp, err := Post("http://127.0.0.1:5000/p", map[string]interface{}{
"aaa": "bbbb",
"ccc": false,
"ddd": 11,
}, Form)
if err != nil {
t.Error(err)
return
}
t.Log(string(resp))
return
}