Skip to content

Instantly share code, notes, and snippets.

@sirkirby
Created September 20, 2024 16:09
Show Gist options
  • Save sirkirby/d5b6e398289f5a4969cda8a67a093154 to your computer and use it in GitHub Desktop.
Save sirkirby/d5b6e398289f5a4969cda8a67a093154 to your computer and use it in GitHub Desktop.
UDM Login request
meta {
name: Login
type: http
seq: 2
}
post {
url: https://{{udm-ip}}/api/auth/login
body: json
auth: none
}
headers {
Content-Type: application/json
}
body:json {
{
"username": "{{username}}",
"password": "{{password}}"
}
}
vars:post-response {
csrf-token: res.headers["x-csrf-token"]
cookie: res.headers["set-cookie"]
}
script:post-response {
bru.setEnvVar("csrf-token",res.headers["x-csrf-token"]);
bru.setEnvVar("cookie",res.headers["set-cookie"]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment