-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't retrieve form data with POST and @RequestParam("myParamName") #724
Comments
I will check it out. |
I was able to reproduce it. |
package io.advantageous.qbit.vertx.bugs;
import io.advantageous.qbit.annotation.RequestMapping;
import io.advantageous.qbit.annotation.RequestMethod;
import io.advantageous.qbit.annotation.RequestParam;
import io.advantageous.qbit.http.client.HttpClient;
import io.advantageous.qbit.http.client.HttpClientBuilder;
import io.advantageous.qbit.http.request.HttpRequest;
import io.advantageous.qbit.http.request.HttpRequestBuilder;
import io.advantageous.qbit.http.request.HttpTextResponse;
import io.advantageous.qbit.reactive.Callback;
import io.advantageous.qbit.server.EndpointServerBuilder;
import io.advantageous.qbit.server.ServiceEndpointServer;
import io.advantageous.qbit.util.PortUtils;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class Bug724 {
@RequestMapping("/")
public static class MyService {
@RequestMapping(value = "/reverse", method = RequestMethod.POST, code = 200)
public void doPostReverse(final Callback<String> callback, final @RequestParam("reverseParam") String reverseParam) {
String retval = reverseParam != null ? new StringBuilder(reverseParam).reverse().toString() : "reverseParam was NULL";
System.out.println("In: " + reverseParam + ", Out: " + retval);
callback.resolve("was=" + reverseParam);
}
}
@Test
public void test() {
final int port = PortUtils.findOpenPortStartAt(8080);
final ServiceEndpointServer serviceEndpointServer =
EndpointServerBuilder.endpointServerBuilder().setUri("/")
.addService(new MyService()).setPort(port).build();
serviceEndpointServer.startServerAndWait();
final HttpClient httpClient = HttpClientBuilder.httpClientBuilder().setPort(port).buildAndStart();
final HttpRequest httpRequest = HttpRequestBuilder.httpRequestBuilder().setUri("/reverse")
.addParam("foo", "bar").addParam("reverseParam", "Rick Loves Java")
.setFormPostAndCreateFormBody().build();
final HttpTextResponse httpTextResponse = httpClient.sendRequestAndWait(httpRequest);
//assertEquals("was=Rick Loves Java", httpTextResponse.body());
}
} |
We ran into this again. |
Fixed |
RichardHightower
pushed a commit
that referenced
this issue
Jun 8, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Method parameter 'String reverseParam' is never populated from a form data submission (constructed by Chrome-Postman client), any ideas what I'm doing wrong (qbit 1.6.0)???
The URL _is_ being called, as the 'System.out...' call is executed ("In: null....").
The text was updated successfully, but these errors were encountered: