net.http: add allow_redirect to FetchConfig (#13285)

pull/13290/head
JalonSolov 2022-01-26 10:13:10 -05:00 committed by GitHub
parent 2d184559b6
commit 01c72d44e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,7 @@ pub mut:
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)
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 {
@ -151,6 +152,7 @@ pub fn fetch(config FetchConfig) ?Response {
cert: config.cert
cert_key: config.cert_key
in_memory_verification: config.in_memory_verification
allow_redirect: config.allow_redirect
}
res := req.do() ?
return res