added endpoints to test functionality properly

This commit is contained in:
Gerardo Roza 2021-01-23 12:40:28 -03:00
parent 0de9172dc6
commit 3e5a1f3e50

View File

@ -4,7 +4,11 @@ import java.util.HashMap;
import java.util.Map;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
@ -18,4 +22,14 @@ public class WebClientController {
response.put("field", "value");
return response;
}
@PostMapping("/resource")
public String postResource(@RequestBody String bodyString) {
return "processed-" + bodyString;
}
@PostMapping(value = "/resource-multipart", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public String handleFormUpload(@RequestPart("key1") String value1, @RequestPart("key2") String value2) {
return "processed-" + value1 + value2;
}
}