Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
pm.sendRequest({
url: '{{your url}}',
method: 'POST',
header: {
'Content-Type': 'multipart/form-data',
},
body: {
mode: 'formdata',
formdata: [
{key: "{{your key}}", value: "{{your value}}", disabled: false, description: {content:"", type:"text/plain"}},
{key: "{{your key}}", value: "{{your value}}", disabled: false, description: {content:"", type:"text/plain"}},
{key: "{{your key}}", value: "{{your value}}", disabled: false, description: {content:"", type:"text/plain"}}
]
}
}, function(err, response) {
//сохраняем парметр set-cookie в переменную
var refresh = response.headers.get('set-cookie');
//обрезаем для получения куки
refresh = refresh.substr(2,36);
//сохраняем в переменную окружения
pm.environment.set("{{your value}}", refresh);
});
@iassainov
Copy link

iassainov commented May 17, 2021

Spasibo!

@TaylorShi
Copy link

TaylorShi commented May 18, 2021

tks u, this help me!

@david-woodside
Copy link

david-woodside commented Jul 28, 2021

Danke viel mals! Ich wußte nicht ganz wie man die formdata aufbauen soll.

@yongchengzhao
Copy link

yongchengzhao commented Dec 9, 2021

感谢分享~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment