How to send double quotes in postman csv data file



  • 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
    
     }
    


  • 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.
    


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2