Costa Posted January 2, 2019 Share Posted January 2, 2019 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 Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted January 11, 2019 Share Posted January 11, 2019 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.