I have an MVC controller that has a method as follows...
[HttpPost]
[ValidateInput(false)]
public ActionResult TestPost(FormCollection fc) {
string res = "Form values (" + fc.Count + "):";
foreach (var key in fc.AllKeys) {
res += key + "=" + fc[key] + "|";
}
return ControllerUtils.XmlView(View("Ok", (object)res));
}
The purpose of this is to test someone else doing an HTTP POST to the controller. The last line just calls a utility method that returns a view containing some XML with the passed string (cast to an object to avoid a compiler error) in one of the tags. The eventual idea is for him to post XML in, which is why I'm returning XML back. I'm sure that bit isn't the issue.
I have someone who is trying to use this from Delphi. For some reason, whenever this method is called, the form collection is empty.
I know this is likely to be a Delphi question, but I wondered if anyone had experienced anything like this. He is using boilerplate code, which shows up as the de-facto method of doing an HTTP POST in hundreds of online articles, blogs and forum posts, so it's hard to say it's wrong, but then the controller code above is so simple that it's hard to see what's wrong here either.
Anyone any ideas why the form collection is always empty? Is there anything I might be doing wrong?