1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

net.http: refactor the Response struct (#10922)

This commit is contained in:
Miccah
2021-07-24 12:47:45 -05:00
committed by GitHub
parent 3979e5c5ff
commit a0e27d3fd9
10 changed files with 242 additions and 160 deletions

View File

@ -37,7 +37,7 @@ fn test_http_fetch_bare() {
}
responses := http_fetch_mock([], FetchConfig{}) or { panic(err) }
for response in responses {
assert response.status_code == 200
assert response.status() == .ok
}
}
@ -68,7 +68,7 @@ fn test_http_fetch_with_params() {
// payload := json.decode(HttpbinResponseBody,response.text) or {
// panic(err)
// }
assert response.status_code == 200
assert response.status() == .ok
// TODO
// assert payload.args['a'] == 'b'
// assert payload.args['c'] == 'd'
@ -88,7 +88,7 @@ fn test_http_fetch_with_headers() ? {
// payload := json.decode(HttpbinResponseBody,response.text) or {
// panic(err)
// }
assert response.status_code == 200
assert response.status() == .ok
// TODO
// assert payload.headers['Test-Header'] == 'hello world'
}