Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send POST parameters with RequestBuilder?

Tags:

webserver

gwt

I'm trying to make a POST request, but I'm not sure how to set parameters. Something like:

RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);

StringBuilder sb = new StringBuilder();
sb.append("key1=val1");
sb.append("&key2=val2");
sb.append("&key3=val3");
rb.setRequestData(sb.toString());

that does not seem to be the current way, though. What's the right way to send params like this with the POST?

like image 717
user291701 Avatar asked Dec 08 '22 18:12

user291701


1 Answers

The answer should be in here Making POST requests with parameters in GWT Try with builder.setHeader("Content-type", "application/x-www-form-urlencoded");

like image 175
SamGamgee Avatar answered Dec 28 '22 10:12

SamGamgee