A.Doszhanov A.Doszhanov - 5 months ago 108
JSON Question

How to send the nested json in POST Request via postman

I am writing project with Java Play Framework 2.5,

and I want to do POST request with nested json via postman

I need to do something like below:

{lesson:{
"id":1,
"name":"Biology"
}}

Answer

I've solved my problem,

the problem was in Java code.

Whenever you get the data from the http, you need to convert it by this way:

String jsonToString = new String(mainJson.get("lesson").toString());

not by this:

Object jsonToString = mainJson.get("lesson").toString()

Also, in postman, I did it as sysquare mentioned

Comments