Adds option for setting custom content type for modify request body.
fixes gh-492
This commit is contained in:
@@ -70,10 +70,8 @@ public class GatewaySampleApplication {
|
||||
)
|
||||
.route("rewrite_request_obj", r -> r.host("*.rewriterequestobj.org")
|
||||
.filters(f -> f.prefixPath("/httpbin")
|
||||
//TODO: add as configuration to modifyRequestBody
|
||||
.setRequestHeader("Content-Type", MediaType.APPLICATION_JSON_VALUE)
|
||||
.addResponseHeader("X-TestHeader", "rewrite_request")
|
||||
.modifyRequestBody(String.class, Hello.class,
|
||||
.modifyRequestBody(String.class, Hello.class, MediaType.APPLICATION_JSON_VALUE,
|
||||
(exchange, s) -> {
|
||||
return Mono.just(new Hello(s.toUpperCase()));
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user