Here , what I am trying to achieve is the following
- I have already got the body of the request to be made using the @RequestBody annotation .. which is in a String Format
- The body contains many nested parameters .. it is also pretty huge .. something like
{
name : XYZ
age : 21
education : {
primaryschool : XYZ-ABC
secondary school : ABC-123
SubjectsChosen : {Science,Maths}
}}
this is still an oversimplification , the whole request body contains many nested parameters too
What I am trying to achieve is to wrap up the String body along with Headers into a HttpRequestEntity, that I can send along with PostForObject.
Is there a way to achieve this to directly convert the String .. without creating an explicit java class for each of the variables in the body as the body is quite huge ?