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

@ -596,7 +596,7 @@ fn get_all_modules() []string {
println('Failed to search vpm.vlang.io. Status code: $r.status_code')
exit(1)
}
s := r.text
s := r.body
mut read_len := 0
mut modules := []string{}
for read_len < s.len {
@ -733,7 +733,7 @@ fn get_module_meta_info(name string) ?Mod {
errors << 'Error details: $err'
continue
}
if r.status_code == 404 || r.text.trim_space() == '404' {
if r.status_code == 404 || r.body.trim_space() == '404' {
errors << 'Skipping module "$name", since "$server_url" reported that "$name" does not exist.'
continue
}
@ -741,7 +741,7 @@ fn get_module_meta_info(name string) ?Mod {
errors << 'Skipping module "$name", since "$server_url" responded with $r.status_code http status code. Please try again later.'
continue
}
s := r.text
s := r.body
if s.len > 0 && s[0] != `{` {
errors << 'Invalid json data'
errors << s.trim_space().limit(100) + ' ...'