I have a question from PostMan rather, it turns out that in my controller I have a GET request in which I have to send an @RequestBod, I have been asked to do a POST and with the method
@RestController
public class TestController {
@GetMapping("/test")
public ResponseEntity<Test> example (@RequestBody Test test){
return new ResponseEntity<>(test, HttpStatus.OK);
}
}
The Test model has only one attribute that is a String and is called a test.
public class Test {
public String test;
public Test(String test) {
this.test = test;
}
public String getTest() {
return test;
}
public void setTest(String test) {
this.test = test;
}
}
I would need to know how to send the RequestBody from Postman, now I do it like that.
Algua help?