28 lines
399 B
Text
28 lines
399 B
Text
meta {
|
|
name: login
|
|
type: http
|
|
seq: 2
|
|
}
|
|
|
|
post {
|
|
url: {{url}}/auth/login
|
|
body: json
|
|
auth: inherit
|
|
}
|
|
|
|
body:json {
|
|
{
|
|
"userName": "{{username}}",
|
|
"password": "{{password}}"
|
|
}
|
|
}
|
|
|
|
script:post-response {
|
|
const body = res.getBody()
|
|
bru.setEnvVar("token", body.token)
|
|
bru.setEnvVar("tokenExpireDate", new Date().valueOf() + (body.expiryDate))
|
|
}
|
|
|
|
settings {
|
|
encodeUrl: true
|
|
}
|