0

I am making a web app and part of the app is designed in ASP.NET MVC and another part in Java with GWT. I need to send a parameter from GWT in ASP.NET.Here is the code:

RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, getRootUrl() + "/" + "SOME_CONTROLLER");
    return builder.sendRequest("parameter", callback);

My question is: How can I retrieve this string "parameter" in ASP.NET?

Cœur
  • 37,241
  • 25
  • 195
  • 267
daidai
  • 531
  • 5
  • 10
  • 22

1 Answers1

1

If you're using a GET method, the data parameter to sendRequest is ignored (because GET requests don't have a payload/body).

So either switch to POST, then you'll be posting "raw data" (note: you should set the Content-Type header to match what you're sending; here it looks like text/plain), so you'll have it in Request.InputStream in ASP.NET MVC.
You might have to seek back to the beginning of the stream though: see https://stackoverflow.com/a/17858159/116472

Or switch to a proper GET, passing the parameter in the URL somehow (query-string, whatever).

Community
  • 1
  • 1
Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164