NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Simpler way to POST data to a site using System.Net.Http.dll in TestSTand or using another component.

I want to post data to a HTTP site using TestStand. I have managed to do that by using the System.Net.Http.dll. However it seem to be a bit to complicated. The problem is that correct media type (in this case "application/x-www-form-urlencoded") of the message content must be set using an Object Reference. It is possible to do that in a rather complicated way by creating a Request Message and use the Request Message header to set the media type. After that adding the content to the Request Message and finally Post the Request Message.

 

Is there an easier way to do thet using the System.Net.Http.dll or is there another component that makes it simpler ?

Ofcourse there is other ways to do this by for example use a script langauage but it would be rather nice if there is some component for this that is easy to integrate with TestStand.

0 Kudos
Message 1 of 3
(2,955 Views)

i have been able to post data to  https://emoncms.org/ with labview assuming is a standard post & get request.. I did this... 

 

is this what you are looking for?

CLAD, CTD
0 Kudos
Message 2 of 3
(2,933 Views)

Not exactly. I can do what I need to do for the moment by using the common .NET component "System.Net.Http.dll". Geting data using the .NET component is simple. Posting data is much more complicated, becouse it need to know the HTTP text encoding format (media type).

 

My question is if I have missed some simple method for that component?

 

There is a simple POST method that takes a string content, but becouse it must need to know the HTTP text encoding format (media type) and that is passed as an object reference it gets a little bit to complicated.

0 Kudos
Message 3 of 3
(2,902 Views)