Closed s3vrlinux closed 5 years ago
Hello, I'm trying to get a simple parameter from the front end.
wget --user-agent=Mozilla/5.0 --post-data='param1=ridiculous' http://localhost:8080/myapp/test
` @Post("/test") public void test(String param1) {
this.result.use(json()).withoutRoot()
.from("RESULT: " + param).recursive().serialize(); }` when testing the rest url with wget the return is null.
if I send a json request all works fine, ex: ` @Consumes("application/json") @Post("/test") public void test(String param1) {
.from("RESULT: " + param).recursive().serialize(); }
wget --user-agent=Mozilla/5.0 --header='Content-Type:application/json' --post-data='{param1=ridiculous}' http://localhost:8080/myapp/test ` When sending the same parameter as GET, ex: @Get("/test") all works fine too.
Why does not the Post work? My pom.xml https://github.com/edilinux/vraptor-test/blob/master/pom.xml
Thanks!
Hello, I'm trying to get a simple parameter from the front end.
wget --user-agent=Mozilla/5.0 --post-data='param1=ridiculous' http://localhost:8080/myapp/test
` @Post("/test") public void test(String param1) {
.from("RESULT: " + param).recursive().serialize(); }` when testing the rest url with wget the return is null.
if I send a json request all works fine, ex: `
@Consumes("application/json") @Post("/test") public void test(String param1) {
.from("RESULT: " + param).recursive().serialize(); }
wget --user-agent=Mozilla/5.0 --header='Content-Type:application/json' --post-data='{param1=ridiculous}' http://localhost:8080/myapp/test ` When sending the same parameter as GET, ex: @Get("/test") all works fine too.
Why does not the Post work? My pom.xml https://github.com/edilinux/vraptor-test/blob/master/pom.xml
Thanks!