http: mutable request fields

pull/4642/head
jm-duro 2020-04-28 13:57:48 +02:00 committed by GitHub
parent 1e4e882bc2
commit 210b6e36b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

13
examples/fetch.v 100644
View File

@ -0,0 +1,13 @@
import time
import net.http
fn main() {
resp := http.get('https://vlang.io/utc_now') or {
println('failed to fetch data from the server')
return
}
t := time.unix(resp.text.int())
println(t.format())
}

View File

@ -12,7 +12,7 @@ const (
)
pub struct Request {
pub:
pub mut:
method string
headers map[string]string
cookies map[string]string