LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Where to put the params when using TCP/HTTP

The case is that a http request is something like www.ni.com?uid=12345.

Since the case involve OAuth, the TCP vis are used instead of HTTP vis.

And my problem is where to put the "uid=12345" info. in the http header string?

 

 

-----------------------

ahunter

 

0 Kudos
Message 1 of 2
(2,267 Views)

If you use the TCP functions you have to do everything on your own. Your URI needs to be parsed and seperated into its various components, such as scheme, autority, host, port, query etc. The host and port part is needed for the TCP Open function, then you construct a HTTP text string that builds the correct HTTP protocol elements using all of the sub parts you got from parsing the UTI. It's anything but trivial to really get this all right but it is doable.

 

Your ?uid=12345 is the query component and would have to be added to the path of the HTTP GET request in the formatted HTTP message that you write to the TCP socket using the TCP Write primitive.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 2
(2,257 Views)