I created a simple mvc3 site with a home controller with these actions.
public JsonResult Param(string id)
{
string upper = String.Concat(id, "ff");
return Json(upper);
}
public ContentResult Param2(string id)
{
string upper = String.Concat(id, "ff");
return Content( upper);
}
public JsonResult Param3(string id)
{
string upper = String.Concat(id, "ff");
io gg = new io();
gg.IOName = upper;
return Json(gg);
}
}
public class io
{
public string IOName {get;set;}
}
I am using Delphi XE and the IPworks that came with it.
Problem #1. No matter what I do I cannot send the post data. I set a breakpoint on the functions. So id is always null.
So these work (for posting data only) for any url.
Json1.Get('http://localhost:1257/home/Param?id=ss');
REST1.Get('http://localhost:1257/home/Param2?id=kk');
But these DO NOT work (for posting data only) for any url.
REST1.PostData :='id=110559%2C102%2C0%2C0';
REST1.POST('http://localhost:1257/home/Param2');
or
json1.PostData:='id=110';
Json1.post('http://localhost:1257/home/Param');
but this works for posting
Webform.AddFormVar('id', '110559%2C102%2C0%2C0');
Webform.SubmitTo('http://localhost:1257/home/Param2');
SO How am I formatting my parameters wrong????
Also I Never get the variable gg formatted in a JSON way. Either blank or an error
GET requests are disabled by default for actions returning JSON. You can enable them like this: