How Can I Get The Starter Kit to Return JSON Responses as JSONP

Last post 11-19-2009 4:18 PM by rgperez. 2 replies.

Sort Posts:

  • How Can I Get The Starter Kit to Return JSON Responses as JSONP

    10-14-2009, 6:13 PM
    • Member
      point Member
    • rhizohm
    • Member since 03-08-2008, 6:12 AM
    • Posts 2

    Didn't see this in the docs anywhere and wondering if it is supported to return JSON Responses as JSONP, as in

    [WebGet(UriTemplate = "?callback={callback}]

    string GetData(string callback)

    and then populate the return value with whatever was passed in the callback variable, aka if the variable that was passed was "cb" it would return:

     

    cb({"key":"value"})

    instead of just

    {"key":"value"}

     

  • Re: How Can I Get The Starter Kit to Return JSON Responses as JSONP

    10-15-2009, 1:14 PM
    • Member
      90 point Member
    • randallt
    • Member since 02-11-2009, 4:53 PM
    • Posts 30

    Unfortunately, the REST Starter Kit does not provide support for JSONP.  But look for JSONP support in WCF REST with Visual Studio 2010 and .NET 4.0.  The Beta1 currently available doesn't have it, but Beta2 (available soon) will.

    Thanks  

  • Re: How Can I Get The Starter Kit to Return JSON Responses as JSONP

    11-19-2009, 4:18 PM
    • Member
      2 point Member
    • rgperez
    • Member since 11-19-2009, 4:16 PM
    • Posts 1

    You can go to this link for an article on JsonP: I tested and works :)

    http://visitmix.com/Opinions/JSON-P-An-Elegant-Hack 

Page 1 of 1 (3 items)