取消
显示结果 
搜索替代 
您的意思是: 

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 项奖励
1 条消息(共 11 条)
7,896 次查看

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 项奖励
2 条消息(共 11 条)
7,861 次查看

Hello Sam,

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

 

Joseph

0 项奖励
3 条消息(共 11 条)
7,839 次查看

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 项奖励
4 条消息(共 11 条)
7,804 次查看

Hi Joseph,

 

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

 

Regards, 

 

0 项奖励
5 条消息(共 11 条)
7,773 次查看

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 项奖励
6 条消息(共 11 条)
7,739 次查看

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 项奖励
7 条消息(共 11 条)
7,733 次查看

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 项奖励
8 条消息(共 11 条)
7,694 次查看

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 项奖励
9 条消息(共 11 条)
7,685 次查看

Yiran,

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

0 项奖励
10 条消息(共 11 条)
7,674 次查看