LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP protocol and authentication

Hello,

I downloaded the HTTP protocol example: http://www.ni.com/example/28153/en/

 

However, I am not sure where to put the authentication (base64 username:password).

 

thanks in advance.

0 Kudos
Message 1 of 11
(7,892 Views)

Which version of LabVIEW are you using?

 

Newer versions have the HTTP Client library which includes the ability to use HTTP Authorisation:

2015-11-06_09-45-45.png

 

You can wire a username/password into the Open Handle VI.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 11
(7,857 Views)

Hello Sam,

Your response is of great help! I will try to see if this helps me and report back.

 

Joseph

0 Kudos
Message 3 of 11
(7,835 Views)

Hello Sam,

I have coded the GET.vi. I first "open handle", then GET, then close the handle.  I am getting "301Moved Permanently".   I understand this is a redirection. I try the redirected URL and still no luck. I get "could not verify authenticity". 

However, when I insert "www.ni.com" with the above code, I get a 200 Ok.

 

Also, when I used this site: https://www.hurl.it/ to check out the website for my project, I get a 200 Ok (both redirected URL and original URL is used).

 

 

0 Kudos
Message 4 of 11
(7,800 Views)

Hi Joseph,

 

What are you trying to GET from? That interaction sounds like something coming from the web service end. 

 

Regards, 

 

0 Kudos
Message 5 of 11
(7,769 Views)

Hello Vitsen,

I am trying to do a simple test for now.  Obtain a "200 OK" when excuting the GET.VI.  I have used www.ni.com with sucess. But when I use the website for my project, I get a 301. I use the redirected website I get "could not verify authenticity".

 

thanks in advance.

0 Kudos
Message 6 of 11
(7,735 Views)

Hello Vitsen,

In my opinion, I think it is on the LabVIEW end because, I have used https://www.hurl.it/ to see if the GET command fails. I does not. But with LabVIEW it fails.  

0 Kudos
Message 7 of 11
(7,729 Views)

Hi Joseph,

 

It definitely is strange that your website isn't working. However in most scenarios, OpenHandle.vi from the HTTP client palette works for basic access authorization. Is that what you have set up with your website? Would the base64 representation make any difference?

0 Kudos
Message 8 of 11
(7,690 Views)

Hello Yiran,

I don't think it is an authentication issue. I say this because in the the following website:  https://www.hurl.it/  I can insert the website and get a "200 OK".

0 Kudos
Message 9 of 11
(7,681 Views)

Yiran,

I forgot to mention, that website,  https://www.hurl.it/ , I don't use any authentication.

0 Kudos
Message 10 of 11
(7,670 Views)