I couldn't find how to automate parse responce and use in next GET request
###
POST http://localhost/coolsoftware/rest/authentication?login=username&password=1234
---- response will be
…
Set-Cookie: JSESSIONID=028EBF489BDF2D88A8A70935F4CA7C04; <-- I need this
…
###
GET http://localhost/coolsoftware/rest/bills/
Cookie: JSESSIONID=028EBF489BDF2D88A8A70935F4CA7C04; <-- to use here
POST http://localhost/coolsoftware/rest/authentication?login=username&password=1234
> {% client.global.set("yourVariable", response.headers.valueOf('Set-Cookie')); %}
And then:
GET http://localhost/coolsoftware/rest/bills/
Cookie: {{yourVariable}}
If there are more than one Set-Cookie header, you should use valuesOf()
instead (available in the latest EAP), and then iterate through the array assigning vars.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With