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

net.http: Response.text -> Response.body (#14478)

This commit is contained in:
Hunam
2022-05-29 19:27:18 +02:00
committed by GitHub
parent 2c5febe25e
commit 78d1b7f4ef
19 changed files with 65 additions and 74 deletions

View File

@@ -17,9 +17,9 @@ fn test_http_get_from_vlang_utc_now() {
println('Test getting current time from $url by http.get')
res := http.get(url) or { panic(err) }
assert res.status() == .ok
assert res.text.len > 0
assert res.text.int() > 1566403696
println('Current time is: $res.text.int()')
assert res.body.len > 0
assert res.body.int() > 1566403696
println('Current time is: $res.body.int()')
}
}
@@ -39,7 +39,7 @@ fn test_public_servers() {
println('Testing http.get on public url: $url ')
res := http.get(url) or { panic(err) }
assert res.status() == .ok
assert res.text.len > 0
assert res.body.len > 0
}
}
@@ -51,6 +51,6 @@ fn test_relative_redirects() {
} // tempfix periodic: httpbin relative redirects are broken
res := http.get('https://httpbin.org/relative-redirect/3?abc=xyz') or { panic(err) }
assert res.status() == .ok
assert res.text.len > 0
assert res.text.contains('"abc": "xyz"')
assert res.body.len > 0
assert res.body.contains('"abc": "xyz"')
}