I want to perform a post using netty4 in camel but its returning bad request 400, i have tried many permutations of http options to see if any work but the result is same (as consumer its working but as producer its not)
@Component public class RestDslRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
restConfiguration()
.component("netty4-http")
.host("localhost").port("8686")
.enableCORS(true)
.corsHeaderProperty("Access-Control-Allow-Origin", "*")
.corsHeaderProperty("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS")
.bindingMode(RestBindingMode.json);
rest("/api")
.get("/")
.to("bean:helloBean")
.post().type(PostRequestType.class)
.to("bean:postBean");
/*from("netty4-http:http://localhost:8686/foo")
.transform().constant("Bye World");
*/
from("netty4-http:http://localhost:8686/foo")
.log("Logged id issue without body: ${header.id}")
.to("netty4-http:http://ptsv2.com/t/8wl8p-1547734804/post?bridgeEndpoint=true");
}