Secured HTTP GET authentication


Recommended Posts

I have a device which I would like to pull XML data from with GET.  Going via a browser works fine but through DAQ is not so fortunate as it requires authentication.  With http://user/pwd@ both depriciated and considered an invalid URL I am unable to easily pull information.  Is there experience and/or examples on the forum using headers to pass authentication that would complete this task?

 

Thanks

Link to comment
Share on other sites

  • 2 weeks later...

The latest build of DAQFactory (but I'm not sure about the latest release) adds several options to the HTTP.Get() function.  That function now looks like:

response = HTTP.Get(URL, [remote path], [port], [extra headers], [secure], [get headers])

URL is the URL without HTTP:// and without any path, so for example "www.azeotech.com"

Path is the path on the server, and defaults to "/"

Port defaults to 80

extra headers is a string with any extra headers you want to add.  They'll need to be formatted as if they were in the actual header as I believe they are just injected into the default headers.  Windows handles this.

Secure = non-zero does an SSL connection (https://).  If 0, it is a straight HTTP connection

If [get headers] is supplied and non-zero, then response is a 2 element array.  The first element is the response content, the second element is the headers for the response.  If [get headers] is 0, or not supplied, then response is just a string with the content.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.