I'm tryint to post to a ADO.NET Data Service but the parameters seems to get lost along the way.
I got something like:
[WebInvoke(Method="POST")]
public int MyMethod(int foo, string bar) {...}
and I make an ajax-call using prototype.js as:
var args = {foo: 4, bar: "'test'"};
new Ajax.Requst(baseurl + 'MyMethod',
method: 'POST',
parameters: args,
onSuccess: jadda,
onFailure: jidda
}
If I replace "method: 'POST'" with "method: 'GET'" and "WebInvoke(Method="POST")" with "WebGet" everything works but now (using post) all I get is:
Bad Request - Error in query syntax.
from the service.
The only fix (that I don't want to use) is to send all parameters in the URL even when I perform a post. Any ideas are welcome.