3

I have the following request body:

{

username:{{user}},
password:{{pass}}

}

The expected structure of the request is :

{

username:"something",
password:"something"

}

if the request body is something like, below then i have to validate that i get 400 status code :

{

  username:something,
  password:tes45

 }

1 Answer 1

3

This is interesting,

Newman and the collection runner are behaving differently. I have raised a bug on postman for this :

https://github.com/postmanlabs/postman-app-support/issues/8024#issue-562149355

So coming to your question :

To run from collection runner wrap double-quotes between double quotes:

user,pass
"""something""","""something"""

To run from newman, escape double-quotes using blackslash:

user,pass
"\"something\"","\"something\""           //here the outer double quotes tell the parser that its a string , and inside we write \" to escape it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.