Possible Duplicate:
JSONP with MVC 4 WebApi
I have a get method for my WebAPI which is as follows:
private T Get<T>(string uri)
{
T result = default(T);
bool isSuccess = true;
client
.GetAsync(uri)
.ContinueWith(task =>
{
// EnsureStatus
isSuccess = task.Result.IsSuccessStatusCode;
task
.Result
.Content
.ReadAsAsync<T>()
.ContinueWith(t => result = t.Result)
.Wait();
})
.Wait();
return result;
}
The result is produced in a JSON format but I want it for JSONP.
I have read that ReadAsSync
only handles built in mediaformatters. So is there a way I can change it to handle JsonP?