How to get "Location" response header using playwright?

41 views Asked by At

Problem: I try to get all response headers using playwright request, but there no "Location" header. Could you help me how i can resolve the problem?

My code:

const pw = await request.newContext({
    ignoreHTTPSErrors: true,
    extraHTTPHeaders: { 'my-device-id': 'value' } });

const response = await pw.post(fsUrl, {
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded',
                    },
                    form: {
                        UserName: usr.login,
                        Password: usr.password,
                        AuthMethod: 'FormsAuthentication',
                    },
                });

                console.log(response.headersArray());

Context: [email protected]

I tried to add request header 'Access-Control-Expose-Headers': 'Location',

0

There are 0 answers