Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3637

Spring RestTemplate POST Query with Headers and Body

$
0
0

I need to consume the given API definition, But I am not able to find a function call that takes both headers and request body at documentation. Please suggest which function of RestTemplate to use here.

@RequestMapping(value = "/createObject", method = RequestMethod.POST,        consumes = MediaType.APPLICATION_JSON_VALUE,         produces = MediaType.APPLICATION_JSON_VALUE)public ResponseEntity<CreateObjectOutput> createObject(        @RequestBody CreateObjectInput req) {    CreateObjectOutput out = new CreateObjectOutput();    ///// Some Code    return new ResponseEntity<CreateObjectOutput>(out, HttpStatus.OK);}

Viewing all articles
Browse latest Browse all 3637

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>