From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to do HTTP POST in LabWindows CVI

I would like to do a HTTP POST in LabWindows CVI. Do you have any suggestion?

I have successfully done that in Visual Studio using C++ with the libcurl library.

But, when I was trying to migrate my libcurl into CVI, it does not compile.

 

Please advise.

 

Thank you,

0 Kudos
Message 1 of 5
(5,697 Views)

I do not think we have any HTTP libraries, but here is an example of making HTTP Requests using .NET Controllers in LabWindows/CVI.

 

Hope it helps!

Regards,

Anjelica W.
National Instruments
Product Marketing Manager
FlexLogger and TestStand
0 Kudos
Message 2 of 5
(5,674 Views)

I've done this in CVI using the telnet library and manually putting together the appropiate commands to send to the web server.  It's a bit tedious but I made it work.

0 Kudos
Message 3 of 5
(5,666 Views)

Hello ,

 

I have some difficulties to make it work, can you send me you source please.

Thanks a lot.

Rgds

0 Kudos
Message 4 of 5
(5,155 Views)

Hi Sebi,

 

To make an HTTP POST with labwindows you have to use ConnectToTCPServer (with port number = 80 ) to connect to your server.

And then ClientTCPWrite/ClientTCPRead to send your POST request and read back answer.

 

Here is a sample POST request to be sent by ClientTCPWrite :

 

POST /yourpath HTTP/1.1
From: yoururl.com
User-Agent: yourtool
Content-Type: text/plain
Content-Length: 20

some data to be sent

 

Regards,

Stef

Labwindows/CVI user since version 4.0
0 Kudos
Message 5 of 5
(5,092 Views)