(t *testing.T)
| 141 | } |
| 142 | |
| 143 | func TestPostStandard(t *testing.T) { |
| 144 | requestAddr := runGoHTTPServer() |
| 145 | |
| 146 | req := New() |
| 147 | req.SetURL(requestAddr + "/post") |
| 148 | req.SetHeaders(map[string]string{ |
| 149 | "Authorization": "Bearer token", |
| 150 | }) |
| 151 | req.SetBody(&myBody{ |
| 152 | Name: "foo", |
| 153 | Email: "bar@gmail.com", |
| 154 | }) |
| 155 | |
| 156 | resp, err := req.POST() |
| 157 | if err != nil { |
| 158 | t.Fatal(err) |
| 159 | } |
| 160 | |
| 161 | result := &StdResult{} |
| 162 | err = resp.BindJSON(result) |
| 163 | if err != nil { |
| 164 | t.Fatal(err) |
| 165 | } |
| 166 | |
| 167 | t.Logf("%+v", result) |
| 168 | } |
| 169 | |
| 170 | func TestPutStandard(t *testing.T) { |
| 171 | requestAddr := runGoHTTPServer() |
nothing calls this directly
no test coverage detected