WinRT C# - HttpRequestException: error 500

后端 未结 1 1433
再見小時候
再見小時候 2021-01-15 03:58

I\'m trying to port my WP8 application to a Windows Store App and I\'m getting an HttpRequestException when performing the getStringAsync of the HttpClient.

Here is

相关标签:
1条回答
  • 2021-01-15 04:14

    Fiddler is your friend!

    Appears that service isn't too happy about being called when there's not a user-agent string passed in the request headers. Try adding:

    client.DefaultRequestHeaders.Add("user-agent", "blah blah blah");
    

    between your two lines of code. There's nothing magic in the blah blah blah part :), and it seems to work with your service, but who knows what, if any, interpretation the service is making of the UA string.

    0 讨论(0)
提交回复
热议问题