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: 

Http service using python

i am facing this error while i  am trying to connect http web server to this python code where labview is server and python as client to receive message status as ok in python but i am just getting empty string {}

import requests

# URL of the LabVIEW Web Service
url = "http://127.0.0.1:80/WebService1/anupvi" # Update to match your web service URL

# Sending a GET request
response = requests.get(url)

# Print the response from LabVIEW
if response.status_code == 200:
print("Response from LabVIEW:", response.json())
else:
print("Failed to connect. Status code:", response.status_code)

Download All
0 Kudos
Message 1 of 3
(714 Views)

Screenshot (40).pngScreenshot (41).png

here labview act as a server and python is acting as client. but im getting empty string in python output. can sameone help to resolve this error.

0 Kudos
Message 2 of 3
(706 Views)

As far as I know, you can't use LabVIEW Web Service Request like you do here.
You need to create a WebService inside you project. Here is a tutorial : Tutorial: Creating and Publishing a LabVIEW Web Service to the NI Web Server (Windows) - NI

0 Kudos
Message 3 of 3
(666 Views)