4

Please note that I am trying to send the below request and validate the response on POST method using url `http:*******

Note : I tried sending nested Json as an array like ****[0]='', voucherData[1]='' etc but I got same error.

2
  • Can you please insert characters properly? Too many �
    – Yu Zhang
    Commented Jun 30, 2017 at 8:01
  • 2
    @YuZhang junk chars removed. It would be really appreciable if i get help on above query. Commented Jun 30, 2017 at 9:03

1 Answer 1

1

Here is a tip. Since you know the expected request structure, keep in mind that you can use it almost as-is in Karate. And proper JSON with double-quotes etc. is totally fine. And you can use the multi-line option. So please try this for the request step:

And request
"""
{
  "memberId":"******",
  "memberIpAddress":"******",
  "voucherData":{
     "******":{
        "voucherNo":"*****",
        "voucherValue":"***",
        "voucherIssueDate":"",
        "voucherExpiryDate":"******"
     }
  }
}
"""

And this should work ! Try it.

3
  • 1
    Sure Peter.will let you know asap the result Commented Jun 30, 2017 at 21:05
  • 1
    I saw this is the difference between Karate and Rest Assured that Karate uses data in single quote . Karate vs Rest Assured No need to use double-quotes or “escape” characters.@Peter please note that when i used escape sequence it got success but using single quote threw bad request. Commented Jul 3, 2017 at 21:30
  • Well, ok. I have no idea what you are referring to without an example or better details, but I am glad that something is working for you now. All the best ! Commented Jul 4, 2017 at 17:08

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.