I have one URL with some special characters like |
and &
.
URL is returning JSON data.
When I am trying this URL in browser it will run and return json data but when I am trying using WebClient.DownloadString()
, it will not work.
Example :
Using Browser :
http://websvr.test.com/abc.aspx?Action=B&PacketList=116307638|1355.00
Output :
[{"Column1":106,"Column2":"Buying Successfully."}]
Using WebClient.DownloadString():
using (WebClient wc = new WebClient())
{
var json = wc.DownloadString("http://websvr.test.com/abc.aspx?Action=B&PacketList=116307638|1355.00");
}
Output :
[{"Column1":-107,"Column2":"Invalid Parametrer Required-(RefNo|JBPrice)!"}]