http: mutable request fields
parent
1e4e882bc2
commit
210b6e36b6
|
@ -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())
|
||||
}
|
||||
|
|
@ -12,7 +12,7 @@ const (
|
|||
)
|
||||
|
||||
pub struct Request {
|
||||
pub:
|
||||
pub mut:
|
||||
method string
|
||||
headers map[string]string
|
||||
cookies map[string]string
|
||||
|
|
Loading…
Reference in New Issue