Hi,
I'm getting this exception when trying to hit the "response = request.GetResponse();"
Using following piece of code
int find;
str url,aosUri,activeDirectoryTenant;
str activeDirectoryClientAppId;
str activeDirectoryClientAppSecret;
str postData,activeDirectoryResource;
str aadClientAppSecret,oAuthHeader;
str returnValue,jsonString,jsondszstr;
System.Net.HttpWebRequest request;
System.Net.HttpWebResponse response;
System.Byte[] byteArray;
System.IO.Stream dataStream;
System.IO.StreamReader streamRead;
System.IO.StreamWriter streamWrite;
System.Net.ServicePoint servicePoint;
System.Net.ServicePointManager servicePointmgr;
System.Net.HttpVersion version;
CLRObject clrObj;
Newtonsoft.Json.JsonReader reader;
System.Text.Encoding utf8;
Counter countCounter;
Object obj;
Map data;
System.Byte[] byteArraynew;
System.Net.WebHeaderCollection headers = new System.Net.WebHeaderCollection();
str byteStr = strfmt("%1:%2", "abc", "****");
new InteropPermission(InteropKind::ClrInterop).assert();
headers = new System.Net.WebHeaderCollection();
url = "">https://xyz.login";
clrObj = System.Net.WebRequest::Create(url);
request = clrObj;
request.set_Method("Post");
request.set_KeepAlive(true);
request.set_SendChunked(true);
request.set_AllowWriteStreamBuffering(false);
request.set_ContentType("application/json");
//request.set_Accept('text/plain');
utf8 = System.Text.Encoding::UTF8;
byteArraynew = utf8.GetBytes(byteStr);
byteStr = System.Convert::ToBase64String(byteArraynew);
//request.set_ContentLength(byteArraynew.get_Length());
//request.set_ContentLength(byteArraynew.Length);
headers.Add("Authorization", 'Basic ' + byteStr);
request.set_Headers(headers);
servicePoint = request.get_ServicePoint();
System.Net.ServicePointManager::set_Expect100Continue(false);
System.Net.ServicePointManager::set_SecurityProtocol(System.Net.SecurityProtocolType::Tls12);
dataStream = request.GetRequestStream();
dataStream.Write(byteArraynew,0,byteArraynew.get_Length());
dataStream.Close();
//request.set_ContentLength(byteArraynew.Length);
response = request.GetResponse();
//Ignore this part.
dataStream = response.GetResponseStream();
streamRead = new System.IO.StreamReader(dataStream);
jsonString = streamRead.ReadToEnd();
info(strFmt("%1",jsonString));
dataStream.Close();
response.Close();
anyone familiar with this issue kindly suggest some solutions as i'm stuck