From 1377f718eb7b81d2bb1da56b5923288423a0f567 Mon Sep 17 00:00:00 2001 From: anuragkumawat Date: Sun, 27 Mar 2022 10:55:35 +0530 Subject: [PATCH] JAVA-10922 Fix RestTemplateBasicLiveTest in spring-resttemplate module --- .../com/baeldung/resttemplate/configuration/FooController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/FooController.java b/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/FooController.java index dbef16b592..0931bf148c 100644 --- a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/FooController.java +++ b/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/FooController.java @@ -9,6 +9,7 @@ import java.util.Map; import com.baeldung.resttemplate.web.dto.Foo; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; @@ -114,7 +115,7 @@ public class FooController { return id; } - @RequestMapping(method = RequestMethod.POST, value = "/foos/form") + @RequestMapping(method = RequestMethod.POST, value = "/foos/form", produces = MediaType.TEXT_PLAIN_VALUE) @ResponseStatus(HttpStatus.CREATED) @ResponseBody public String submitFoo(@RequestParam("id") String id) {