alias postit {
// build the body as url-encoded form parameters
bset -t &body 1 username={{accountEmail}}&password={{accountPassword}}&remember_me=true&_csrf={{XSRF-TOKEN}}
// build a list of headers, seperated by crlf, inside a bvar:
bset -t &headers 1 Content-Type: application/x-www-form-urlencoded $+ $crlf
bset -t &headers -1 Content-Length: $bvar(&body, 0) $+ $crlf
bset -t &headers -1 Cookie: XSRF-TOKEN={{XSRF-TOKEN}}
// start the request
noop $urlget(https://profile.callofduty.com/do_login?new_SiteId=cod, pb, &response, postit_response, &headers, &body)
}
alias postit_response {
var %id = $1
var %response_bvar = $urlget(%id).target
// do something with %response_bvar
echo -s >> $bvar(%response_bvar, 1-3000).text
}