You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When I set a "location" property in response headers, then it is shown in Browser Chrome DevTools -> Network/Headers, but when I try to get response.headers.location in Code or just console.log repsonse.headers it returns only content.type and content-lenght property
To Reproduce
Here is my code to reproduce. I have tried to only set Location directly in after HTTP and in {{#code}} block. Both return the same result.
You seem to be using a capture helper within the code helper. Unfortunately code helper isn't intended to work in that manner. When you use code helper, you must prepare the response yourself (read more here)
For your use case, you can modify your mock file as follows:
@shubhendumadhukar thank you very much for your example, I just tried it. Unfortunately, I have the same problem, in Browser DevTools I can see the 'location' to set correctly, but in the app code, it still not there:
To fetch data I am using axios. The code looks like:
Would you be able to share the complete set of response headers you receive when you call the actual API instead of the mock? If yes, please ensure that sensitive data, if any, are masked from the response before sharing.
Describe the bug
When I set a "location" property in response headers, then it is shown in Browser Chrome DevTools -> Network/Headers, but when I try to get
response.headers.location
in Code or just console.logrepsonse.headers
it returns onlycontent.type
andcontent-lenght
propertyTo Reproduce
Here is my code to reproduce. I have tried to only set Location directly in after HTTP and in {{#code}} block. Both return the same result.
Expected behavior
When calling
response.headers.location
it should NOT be undefinedDesktop:
The text was updated successfully, but these errors were encountered: