Search code examples
c#jsonhttpresponsewechat

Get response from wechatweb URL


I want to handle the response from the below WeChat URL in my C# App:-

https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect

As mentioned in URL I want to get "code" value as JSON response. I have no idea how I will get the response. how I can achieve that ?


Solution

  • You can find a great tutorial on the MSDN page here: https://learn.microsoft.com/en-us/dotnet/framework/network-programming/how-to-request-data-using-the-webrequest-class

    Also have a look at https://msdn.microsoft.com/en-us/library/system.net.httpwebrequest(v=vs.110).aspx