I recently saw a jQuery example where a POST was made to "Default.aspx/Test", where Test was a WebMethod in Default.aspx, and the content-type for the request was "application/json".
The reply from the WebMethod was in JSON. I always thought WebMethods returned SOAP responses, but if I'm interpreting this code correctly, like I said, the WebMethod returns JSON.
Is this correct? Do WebMethods return a response in the format of the request content-type? Since when has this been possible? Always? Or is this because I have ASP.NET AJAX installed? If so, what namespaces can I disassemble to see how this works?
I've only used WebMethods for .NET to .NET communication, which has been in SOAP, and always written custom code to respond in the correct format (SOAP, JSON, or XML), based on a request query string parameter specifying the desired format. I always thought WCF was required for this kind of metaformat functionality.