I want to get all parameters (not need for headers) from an httpRequest in à spring service component
I'm using Spring boot, look at this example :
private final MyService myService;
@RequestMapping(value = "/processform/{process_id}", method = RequestMethod.POST)
public @ResponseBody
LinkedHashMap<String, String> runForm( String process_id,
@RequestParam String className,
@RequestBody(required = false) IupicsFormVO vo) {
return myService.run(process_id, className, vo);
}
This controller generate this curl (without headers):
curl -X POST \
'http://localhost:8087/processform/119?className=com.stackOverflow.question.ClassName.java' \
-d '{
"name" : "Name",
"age" : "Age"
}'
Now what i need is to get all parameters from this URL (may be with injecting HttpServletRequest
)
The expected result is kind of :
{
"process_id":"119",
"className":"com.stackOverflow.question.ClassName.java",
"body":{
"name":"Name",
"age":"Age"
}
}
I found this example,
String finalPath = apm.extractPathWithinPattern(bestMatchPattern, path
but when i use'it i got always en empty finalPath Thanks for your time