My WebApi action returns a dynamic object built from JObject.parse(jsonString);
I have GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear();
But that object is wrapped inside a default result message in the response.
According to this article returning anonymous objects is fine and should give the expected result
I am using an async controller because I have to await some ReadAsStringAsync() here the protoype of my action:
public async Task<dynamic> Pics(string flavor, int pagesize)
Expected result :
{"flavor":"","maxFeedSize":0,"mediaContent":[]}
Result I have when returning the dynamic object:
{
"Result": {
"flavor": "",
"maxFeedSize": 0,
"mediaContent": []
},
"Id": 1,
"Exception": null,
"Status": 5,
"IsCanceled": false,
"IsCompleted": true,
"CreationOptions": 0,
"AsyncState": null,
"IsFaulted": false
}
Task<dynamic>... can you post all of your controller action code?