12-03-2020 05:47 PM
Dear reader,
I'm trying to have Labview request data from an ajax call
So, labview request data from a web service, the web service respond and I get the data in labVIEW ! As simple as that !
However, even using https://forums.ni.com/t5/Example-Code/Response-to-AJAX-HTTP-Request-with-LabVIEW/ta-p/3527887?profil... i'm having trouble using it...
on the getlogin.html, I changed the url to have the request of what I want ; When open the file, I click on "get login", boom, I have in the console the data I want ! WIN !
So, now I would like to have that response in LabVIEW !
FYI, the answer from the ajax request is JSON, so I should be able to "explode" it in LabVIEW no problem (As long as I got it there !)
In labview, the error I got is -67301 :
Possible reason(s):
LabVIEW: (Hex 0xFFFEF91B) LabVIEW Web Services: Invalid Request ID.
Complete call chain:
NI_WebServices.lvlib:Error Converter (ErrCode or Status).vi
NI_WebServices.lvlib:Web Request.lvclass:Set HTTP Response MIME Type.vi
Index.vi
Probably something stupid, but any help is appreciated !
Thank you !
Solved! Go to Solution.
12-03-2020 05:56 PM
If you attached a VI, it would help show us what you are doing.
Without it, we can only guess. My first thought is that you need something in the header of the HTTP request.
12-03-2020 06:05 PM
I literraly use the one from the example here : https://forums.ni.com/t5/Example-Code/Response-to-AJAX-HTTP-Request-with-LabVIEW/ta-p/3527887?profil... ; Except the url ; I changed it to something internal to our network
Except for that, exactly the same !
12-04-2020 12:10 PM
Howdy !
Here is the code I'm trying to execute ;
It does a simple ajax call to a test server and get a data ;
The HTML works and populate the box ; I would like to have the value of that box in labview !
Do you think this is possible ?
Thank you for all your help !
Benoit
12-04-2020 12:19 PM
Please attach a true zip file and not a .7z file.
No reason to make others install 3rd part programs when Windows natively handles zip files
12-04-2020 12:21 PM
My bad...
see attached
12-04-2020 01:55 PM
following this solution, I solved my problem !
Thank you
Benoit
12-04-2020 04:10 PM
Excellent!