I have a login post request.
@RequestMapping(value = EWPRestContants.DO_LOGIN, method = RequestMethod.POST, consumes=MediaType.APPLICATION_XML_VALUE,produces=MediaType.TEXT_PLAIN_VALUE)
public ResponseEntity<String> doLogin(@RequestBody Loginrequest logReq,@RequestHeader HttpHeaders headers, HttpServletRequest request, HttpServletResponse httpResponse) throws Exception {
//........
}
I want to extract data from the header. Is there an API to do so?
Suppose my header contains customer msIsdn number and name. How do I fetch those details. getFirst() is used to get the user-agent details or the start line only.
This is the answer.
String id= headers.getFirst("ID");