We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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({....});
({.....});
myCallback({....});
Where am I going wrong?
The text was updated successfully, but these errors were encountered:
Settled for enabling CORS on Web API project rather trying to handle JSONP calls. But this is still a issue though.
Sorry, something went wrong.
why responding this?
I am getting the same error
added a quick fix #48
R I P
Successfully merging a pull request may close this issue.
I have the following in my Web API action:
But it is responding with:
({.....});
instead ofmyCallback({....});
Where am I going wrong?
The text was updated successfully, but these errors were encountered: