Last post Oct 02, 2008 01:34 AM by Vinija
Sep 29, 2008 03:31 PM|rippetoe|LINK
I have created a simple web service and method that returns 'Hello World', but I want the method to return the string as json. I have set ResponseFormat = ResponseFormat.Json and on the client I have set the request content type to "application/json; charset=utf-8".
Still, the response is always xml. Any thoughts about what i need to change to get a json response. I am using Prototype.js to handle all the ajax stuff. I have verified that the request object does have the correct content type and that the response object
does have null for responseJSON and null for headerJSON.
aspnet 3.5, windows server 2008, IIS 7, vb.net
Sep 29, 2008 08:44 PM|gt1329a|LINK
Make sure that the request is a POST request, not a GET. Scott Guthrie has a post explaining why here:
Though it's written specifically for jQuery, this may also be useful to you:
Oct 02, 2008 01:34 AM|Vinija|LINK
Have you set your .Connfig file to enablee AJAX?