HttpWebRequest which was working fine started to returns (400) Bad Request
Hi,
my following code was working fine until couple of days ago. Now it returns "The remote server returned an error: (400) Bad Request."
When I test the request in Postman it works fine. I wonder what's missing. I'll appreciate if you could help me.
// sample url = 'https://www.zohoapis.com/crm/v2/Cases/search?fields=First_Name%2cLast_Name&page=1&per_page=200&criteria=(Status:equals:1 - New Case)"
string requestUrl = GetApiUrl(module, pageNo, criteria, id, selectColumns, sortBy);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(requestUrl);
request.Method = "GET";
request.ContentType = "application/json";
request.Headers["Authorization"] = string.Format("Zoho-oauthtoken {0}", this.AuthToken);
try
{
using (WebResponse response = request.GetResponse())
{
...
}
}
catch (WebException ex)
{
...
}