I am guessing that somehow my datacontracts are messing it up.
The response content type has pretty little to do with any DataContracts or whatever. ASP.NET Web API uses a notion called content negotiation. This means that if the client requests JSON and if the server supports JSON he's gonna return JSON. Same For XML and other content types as well. So make sure that the client is setting the Accepts: application/json
HTTP request header if you expect JSON from the server.
Here's an example of how a valid request might look like:
GET /api/values/123 HTTP/1.1
Host: example.com
Accept: application/json
Connection: close
and a sample response from the server:
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 13
{"foo":"bar"}
And here's the sample controller:
public class ValuesController: ApiController
{
public HttpResponseMessage Get(string id)
{
return Request.CreateResponse(HttpStatusCode.OK, new { foo = "bar" });
}
}