need http response request for a url

Hi all,

I need http response request for the below URL in ax…how to do this by code……/live

I got it…this is the code.

static void ExchRateTest(Args _args)


str url;

str exchRate = “”;

System.Net.HttpWebRequest httpRequest = null;

System.Net.HttpWebResponse httpResponse = null;

CLRObject clro = null;

System.IO.Stream stream = null;

System.IO.StreamReader streamReader = null;


url = “”;

new InteropPermission(InteropKind::ClrInterop).assert();

clro = System.Net.WebRequest::Create(url);

httpRequest = clro;

httpResponse = httpRequest.GetResponse();

stream = httpResponse.GetResponseStream();

streamReader = new System.IO.StreamReader(stream);

exchRate = streamReader.ReadToEnd();

info(strFmt("%1 ",exchRate));



Don’t forget to close all streams when you’re done with them, both when your code succeeded and when it threw an exception.