ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Authentication syntax for HTTP GET method using TCP functions in Labview on linux

Hi,

 

Currently, I am trying to communicate to web server. I have Labview installed on a Linux machine. The HTTP function blocks and other labview functions do not work. Hence, I am building a HTTP code string using TCP functions (port 80) to talk to the web server. I am successfully able to fetch a response from web sites (example www.ni.com) from my vi. However, when I try to communicate to my web server, it does not work. It requires an authentication. I am able to open http://ipaddress in my browser from my machine using username and password. Can someone help with Authentication string requirement for GET method?

 

so far the string is:

GET /index/ HTTP/1.1

Host: http://xx.xx.xx.xx

 

0 Kudos
Message 1 of 5
(6,981 Views)

Hi SS21,

this link should help to solve your problem.

 

Mike

0 Kudos
Message 2 of 5
(6,927 Views)

An easy option would be to try http://user:password@server syntax for the URL.

 

Else I posted a Twitter fetcher once (won't work anymore since Twitter moved to Oauth authentication) at LAVA. Based on code from @cloew.

The code is part of this LLB.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 5
(6,920 Views)

Thanks for all your replies.

MikeS81, your link helped understand the authentication structure, I have added the basic athentication string as part of my GET method string.

TCPlomp, the Base64 conversion in your LLB looks like something I can definitely incorporate for my username and password strings for authentication. I really appreciate you sharing this part of the code.

I will definitely try it out and hope it works.


Regards,
SS21

0 Kudos
Message 4 of 5
(6,904 Views)

Thanks for all your help. It works!!  Smiley Happy

0 Kudos
Message 5 of 5
(6,854 Views)