-1

I'm unable to use the standard {{variable_name}} format for some reason. I'm making a POST request to log into a website that uses ASPX. I intercepted this request when I logged in normally and have been using it since.

This is my current body: ScriptManager1=updpnl%7CbtnLogin&__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwULLTE4NTA1MzM2ODIPZBYCAgMPZBYCAgMPZBYCZg9kFgICAw8PFgIeB1Zpc2libGVoZGRkZQeElbA4UBZ%2FsIRqcKZDYpcgTP0%3D&__VIEWSTATEGENERATOR=6ED0046F&__EVENTVALIDATION=%2FwEdAAbdzkkY3m2QukSc6Qo1ZHjQdR78oILfrSzgm87C%2Fa1IYZxpWckI3qdmfEJVCu2f5cEJlsYldsTO6iyyyy0NDvcAop4oRunf14dz2Zt2%2BQKDEIHFert2MhVDDgiZPfTqiMme8dYSy24aMNCGMYN2F8ckIbO3nw%3D%3D&txtUserid=USERNAME&txtpassword=PASSWORD&__ASYNCPOST=true&btnLogin=Sign%20in

When I replace the username and password with my environmental variables using the {{ }} format, and submit the request, it doesn't work anymore.

How do I use environment variables in this case?

UPDATE:

I solved the issue by exporting the postman collection, and using NodeJS to manually change those parameters via an input. I'm not sure if that's the best way to do it, but this works for me.

Arvind
  • 155
  • 3
  • 12
  • What do you mean by 'it doesn’t work anymore'? In the Postman console you will get an entry for each request made, what does it tell you about what’s been sent in the body of the request? Could you attach an image of Postman with your request please? – Danny Dainton May 04 '18 at 18:42
  • @DannyDainton, it simply redirects me to the login page again instead of actually loggin me in. I found a solution though. – Arvind May 04 '18 at 18:45
  • Can you either update with the solution and add it as an answer or delete the question please. – Danny Dainton May 04 '18 at 18:46
  • I'd done it right before I commented @DannyDainton – Arvind May 05 '18 at 15:11
  • You still need to close out the question by providing that as an answer, if you’re happy. The question will just stay active without doing that. – Danny Dainton May 05 '18 at 15:45

1 Answers1

0

I solved the issue by exporting the postman collection, and using NodeJS to manually change those parameters via an input. I'm not sure if that's the best way to do it, but this works for me.

Arvind
  • 155
  • 3
  • 12