I have a spring boot application that needs a controller that can handle the following request:
The request is sent by another service through the Post method..
Headers
accept-encoding: gzip,deflate
user-agent: Apache-HttpClient/4.3.6 (java 1.5)
connection: Keep-Alive
host: webhook.site
content-type: application/x-www-form-urlencoded
content-length: 558
Query strings:(empty)
Form values
BillNumber: 41492032464
BillValue: 600000.0
Description: Description
I have this controller, but my application returns an HTTP Error 406:
@RequestMapping(value = "/bills", method = RequestMethod.POST, headers = "Accept=application/x-www-form-urlencoded")
@ResponseBody
@Transactional
public void createBill(UriComponentsBuilder uriComponentsBuilder, final HttpServletRequest request,
final HttpServletResponse response) throws IOException {
}
How should this controller be implemented in my spring boot app?
Many Thanks!