Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/
You above code passes the body as,
{"email":"[email protected]","password":"password"}
But, you are supposed to pass it as,
{"data":{"email":"[email protected]","password":"password"}}
So, you can write something like this.
Map<String, Object> data = new HashMap<String, Object>();Map<String, Object> details = new HashMap<>();details.put("email", "[email protected]");details.put("password", "password");data.put("data", details);httpRequest.body(data.toString());
Map<String, Object> data = new HashMap<String, Object>();
Map<String, Object> details = new HashMap<>();
details.put("email", "[email protected]");details.put("password", "password");
data.put("data", details);
httpRequest.body(data.toString());
Try that and let me know what you get in comment.
This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!
1.4k questions
1.6k answers
866 comments
1.9k users