mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
net.http: add allow_redirect to FetchConfig (#13285)
This commit is contained in:
parent
2d184559b6
commit
01c72d44e8
1 changed files with 2 additions and 0 deletions
|
@ -28,6 +28,7 @@ pub mut:
|
||||||
cert string // the path to a cert.pem file, containing client certificate(s) for the request
|
cert string // the path to a cert.pem file, containing client certificate(s) for the request
|
||||||
cert_key string // the path to a key.pem file, containing private keys for the client certificate(s)
|
cert_key string // the path to a key.pem file, containing private keys for the client certificate(s)
|
||||||
in_memory_verification bool // if true, verify, cert, and cert_key are read from memory, not from a file
|
in_memory_verification bool // if true, verify, cert, and cert_key are read from memory, not from a file
|
||||||
|
allow_redirect bool = true // whether to allow redirect
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_request(method Method, url_ string, data string) ?Request {
|
pub fn new_request(method Method, url_ string, data string) ?Request {
|
||||||
|
@ -151,6 +152,7 @@ pub fn fetch(config FetchConfig) ?Response {
|
||||||
cert: config.cert
|
cert: config.cert
|
||||||
cert_key: config.cert_key
|
cert_key: config.cert_key
|
||||||
in_memory_verification: config.in_memory_verification
|
in_memory_verification: config.in_memory_verification
|
||||||
|
allow_redirect: config.allow_redirect
|
||||||
}
|
}
|
||||||
res := req.do() ?
|
res := req.do() ?
|
||||||
return res
|
return res
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue