Created
March 15, 2022 19:14
-
-
Save malcommac/6d3ab17005b40f8299dce9f6b7e0defb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let req = HTTPRequest { | |
$0.url = URL(string: "https://.../login")! | |
$0.method = .post | |
$0.timeout = 15 | |
$0.redirectMode = redirect | |
$0.maxRetries = 4 | |
$0.headers = HTTPHeaders([ | |
.init(name: .userAgent, value: myAgent), | |
.init(name: "X-API-Experimental", value: "true") | |
]) | |
// Setup URL query params & body | |
$0.addQueryParameter(name: "full", value: "1") | |
$0.addQueryParameter(name: "autosignout", value: "30") | |
$0.body = .json(["username": username, "pwd": pwd]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment