danielcrenna/hammock — Issue #41: Doesn't return JSON
Author: amarwadi
Created: 2011-10-08 08:55:10+00:00
State: open

Hello,
I am noticing a really strange issue while testing Hammock for WP7 with the new release Mango.
Here is my code:
var client = new RestClient { Authority = "http://abc.com/apiRest/" };
var request = new RestRequest { Path = "zines/hello", };
request.AddHeader("Accept", "application/json");
client.BeginRequest(request, new RestCallback(GetCallback));

As you can see, I am requesting a JSON response. my WCF Web API is configured such that if I ask for JSON, it will return me JSON, if I ask for XML it will return XML and so on.

This code however only returns XML no matter what I do. Using the same code from a Desktop client behaves correctly. When I change the accept to JSON and XML it returns me data as expected.

Could you please see if there's a specific issue or a reason why it wouldn't function the same in the Windows Phone environment?

Any help will be appreciated.