简体   繁体   中英

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

在邮递员的值字段中,输入json格式,例如

{key:value}

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM