How do I use HttpWebRequest GET method w/ ContentType=“application/json”

前端 未结 4 2005
说谎
说谎 2021-01-14 09:34

This one is real simple, run this Silverlight4 example with the ContentType property commented out and you\'ll get back a response from from my service in xml. Now uncomment

4条回答
  •  一个人的身影
    2021-01-14 09:52

    Can you post the details for the WCF End point? If it is returning XAML, the only way to get JSON is if it is configured to. The initial request simply requests a URL, it is not specifying a "mode" so I'm assuming the WCF is defaulting to XML. There should either be a specific endpoint to go to for JSON responses, or a setting on the WCF to return those only.

提交回复
热议问题