Getting the content of a URL

Getting the content of a URL

  
We use mapquest to generate directions from our location to our prospects.  In the past we used a set of custom dll's that contained the code to generate the directions.  I'd like to walk away from these as they are difficult to use and hard to maintain, and move directly to using the www interface they provide.

That said, I have not found a way to call and external url and capture the results in OS.  Given a url like the following: 

http://www.mapquestapi.com/directions/v1/route?key=OurPassword&from={0}&to={1}&callback=renderNarrative&outFormat=xml


Where we would format in the {0} and {1} with the approperiate addresses, this will return XML, which we would then parse with the XML
extension to generate the directions on the page.

How do I call a URL that is not a web service?
Hi John,

You can use HttpRequestHandler.HttpGet() to retrieve the text content of an http call.
Then to parse the xml you can either use plain simple text functions or the XML extension.

Hope this helps.

Cheers,
Tiago Simões
I must be missing something on this - there does not seem to be an HttpGet action in HttpRequestHandler extension.  There is a GetUrl action, but that seems to be for the running application.
Hi John,

You are right, my bad. That method is in the RichMail extension.

Cheers,
Tiago Simões
Hi John:

There is indeed an HTTP get methody in the HTTPRequestHandler extension. It is called GetRequest_Submit.

You can use the GetRequest_AddArgument to create your URL and add arguments to it.

Hope this helps.

Cheers:

       Miguel
Hi,

I need to get a gif file from this URL:
http://83.240.239.170:7780/chronotrace/chronotrace?us=09990002&pw=09990002&op=podimg&ot=html&skb=09633177001004c&poddt=20101109

i tried to use the GetRequest_Submit (multiple ways) but with no success.

What's missing in the way i'm using it?

Hi João,

i downloaded the file, and it came without extension, added .gif and there it was! so probably the .gif is missing in that image URL.

let us now about it!

regards,
Miguel
Hi Miguel,

The problem is using this action, i'm not able to get the binary file.

Cheers.
Oh i see... 

well instead GetRequest_Submit try using the HttpBinaryGet from the RichMail Extension.

hope this helps.

regards,
Miguel
Splendid!!

Not occurred to me this action, simple forgot it. Thanks a lot!!


Best regards.
Glad to hear that!

Cheers,
Miguel
What is the problem with the GetRequest_Submit ?
I'm also trying to use it, but don't get anything as a result ...