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:
@ -4,14 +4,14 @@ fn test_response_bytestr() ? {
|
||||
{
|
||||
resp := new_response(
|
||||
status: .ok
|
||||
text: 'Foo'
|
||||
text: 'Foo' // TODO: replace with `body` once deprecaped
|
||||
)
|
||||
assert resp.bytestr() == 'HTTP/1.1 200 OK\r\n' + 'Content-Length: 3\r\n' + '\r\n' + 'Foo'
|
||||
}
|
||||
{
|
||||
resp := new_response(
|
||||
status: .found
|
||||
text: 'Foo'
|
||||
body: 'Foo'
|
||||
header: new_header(key: .location, value: '/')
|
||||
)
|
||||
lines := resp.bytestr().split_into_lines()
|
||||
|
Reference in New Issue
Block a user