string frmDateTime = txtfromdate.Text;
string Todate = txtTodate.Text;
var frmstr = HttpUtility.ParseQueryString(frmDateTime);
var Tostr = HttpUtility.ParseQueryString(Todate);
var uri = "https://api.flipkart.net/sellers/v2/orders/search/orderDate?fromDate=" + frmstr + "&toDate =" + Tostr;
var client = new WebClient();
client.Headers.Add("X", "Y");
var inforesponse = client.DownloadString(new Uri(uri)); //error-- The remote server returned an error: (401) Unauthorized.
if (inforesponse != null)
{
}