I recently saw a jQuery example where POST was done in "Default.aspx / Test", where Test was WebMethod in Default.aspx, and the content type for the request was "application / json".
The response from WebMethod was in JSON. I always thought that WebMethods returns SOAP responses, but if I interpret this code correctly, as I said, WebMethod returns JSON.
It is right? Do WebMethods return a response in the format of the request content type? Since when is this possible? Is always? Or is it because I have ASP.NET AJAX installed? If so, what namespaces can I parse to see how this works?
I used only the WebMethods interface for .NET for .NET, which was in SOAP, and I always wrote my own response code in the correct format (SOAP, JSON or XML) based on the query string parameter of the request indicating the desired format. I always thought that WCF is required for this kind of meta-format functionality.
source
share