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: 

problems with url-encode_String.vi

Solved!
Go to solution

LV 2011 , OSX 10.7.5.

So I've got  a URL to fetch some json data, works with curl from a shell :

 

curl "http://mst-log.physics.wisc.edu/logbook.py/RPC?json=\{%22function%22:%22fetchTimeLogLatest%22,%22params%22:\{%22group%22:%22ops%22,% 20%22logName%22:%22tank_temps%22\}\}"

(returns a json structure you can parse as a string)

( wont' work for you, er , better not work for you, outside our firewall ! 😉 )

 

Just feeding the URL above from "mst-log..." ought to just work with GET.vi, no ? but Labview does strange  things.

I can get to the remote server logs and see that labview converts some characters when I tried that:

 

[01/Nov/2012:11:31:50 -0500] "GET /logbook.py/RPC?json=%5c%7b%22function%22:%22fetchTimeLogLatest%22,%22params%22 :%5c%7b%22group%22:%22ops%22,%20%22logName%22:%22tank_temps%22%5c%7d%5c%7d HTTP/1.1" 500 1654 "-" "National Instruments LabVIEW"

 

Next, tried sending this to url-encode_string.vi   but the vi only returns "mst-" and nothing else. the GET.vi then throws a  "no network" error. 

 

Couple more trials with substituting %xx equivalents into the original string , where the access.log showed LV changing things yields "interesting" results.

 

Can still do it calling curl externally, but surely this should work, no ?

 

Alex

0 Kudos
Message 1 of 2
(3,201 Views)
Solution
Accepted by topic author asquit

Nevermind. URL inputs always change the \{} characters (of course) . curl leaves them in the string. SystemExec.vi works, returns the string .

Still, url-encode_string.vi does odd things.

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