Open
Description
I have the following in my Web API action:
[HttpGet]
public HttpResponseMessage GetProducts(string id)
{
var returnData = data;
string callback = ControllerContext.Request.GetQueryNameValuePairs().Where(kv => kv.Key == "callback").Single().Value;
return Request.CreateResponse(HttpStatusCode.OK, returnData, new JsonpMediaTypeFormatter(new JsonMediaTypeFormatter(),callback), new MediaTypeHeaderValue("text/javascript"));
}
But it is responding with:
({.....});
instead of myCallback({....});
Where am I going wrong?