1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-15 18:22:27 +08:00

fix: fix TestHttpPost timeout issue

This commit is contained in:
dudaodong
2021-12-28 10:56:54 +08:00
parent ec983b7aa6
commit 16b5101600

View File

@@ -32,16 +32,12 @@ func TestHttpGet(t *testing.T) {
} }
func TestHttpPost(t *testing.T) { func TestHttpPost(t *testing.T) {
url := "http://public-api-v1.aspirantzhang.com/users" url := "http://api.postcodes.io/postcodes"
type User struct { type Postcode struct {
Name string `json:"name"` Postcodes []string `json:"postcodes"`
Email string `json:"email"`
} }
user := User{ postcode := Postcode{[]string{"OX49 5NU"}}
"test", bodyParams, _ := json.Marshal(postcode)
"test@test.com",
}
bodyParams, _ := json.Marshal(user)
header := map[string]string{ header := map[string]string{
"Content-Type": "application/json", "Content-Type": "application/json",
} }