using System.IO;
using System.Net;
using System.Text;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.File;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using System.Threading.Tasks;
class DXAPIServiceClass extends SysOperationServiceBase
{
public void processOperation()
{
WebException exception;
HttpWebRequest webRequest;
WebResponse webResponse;
CLRObject clrObj;
System.Exception ex;
System.Byte[] bytes;
System.Text.Encoding encoding;
#OCCRetryCount
webRequest = System.Net.WebRequest::Create('3rd party(external) URL');
webRequest.Method = 'Get';
webRequest.KeepAlive = true;
webRequest.ContentType = 'application/x-www-form-urlencoded';
webRequest.Timeout = maxInt();
System.Net.WebHeaderCollection headers = new System.Net.WebHeaderCollection();
//str auth = this.geLokcal();
Headers = webRequest.Headers;
headers.Add('Authorization', 'Bearer ' + "GubjUjpC5tgmZ8Q85sXYIj");
if (webRequest != null)
{
webResponse = webRequest.GetResponse();
using (StreamReader streamReader = new StreamReader(webResponse.GetResponseStream()))
{
str response = streamReader.readToEnd();
}
webResponse.Close();
}
else
{
throw new System.Exception("Please provide valid URL");
}
}
}
No comments:
Post a Comment