Hello I'm using this method for API call (v1)
- public static string AccessCRM(string url, string postcontent)
- {
- //ServicePointManager.ServerCertificateValidationCallback = ValidateRemoteCertificate;
- WebRequest request = WebRequest.Create(url);
- request.Method = "POST";
- byte[] byteArray = Encoding.UTF8.GetBytes(postcontent);
- request.ContentType = "application/x-www-form-urlencoded";
- request.ContentLength = byteArray.Length;
- Stream dataStream = request.GetRequestStream();
- dataStream.Write(byteArray, 0, byteArray.Length);
- dataStream.Close();
- WebResponse response = request.GetResponse();
- dataStream = response.GetResponseStream();
- StreamReader reader = new StreamReader(dataStream);
- string responseFromServer = reader.ReadToEnd();
- reader.Close();
- dataStream.Close();
- response.Close();
- return responseFromServer;
- }
It was working before but now , it is returning an html instead of xml/json, I tried using POSTMAN or a browser to make a manual API call and it works
Need help ASAP, Thanks in advance