HTTP Retriever and JSON data
-
Hello,
Im trying to read data from JSON service.
JSON data addres is: http://192.168.1.250/iolinkmaster/port[4]/iolinkdevice/pdin/getdata
Data is: {"cid":-1,"data":{"value":"0079FD03"},"code":200}
I used HTTP Retriever, with that URL. Received value is in hexadecimal format, Im interestet in first 4 characters.
Using https://regex-testdrive.com/en/dotest I made a RegEx: .*"value":"([0-9A-Z]+)FD03"},"code":200}
Next I made a data point with that RexEx. But when I click on "Test value parameters" button I get error: java.lang.IllegalArgumentException: Illegal character in path at index 38: http://192.168.1.250/iolinkmaster/port[4]/iolinkdevice/pdin/getdata
Also it doesn't matter if I use RegEx on data point - I still get that error trying to test value. .
And now I need help how to resolve this error.
Also my next question is how to convert hexadecimal data value to decimal.Regards.
-
Hi CooL3R
Looks like your URL has illegal characters. try replacing [ & ] with %5B and %5D respectively. You will probably need to make a meta point to convert the point to decimal.
-
@craigweb said in HTTP Retriever and JSON data:
Looks like your URL has illegal characters. try replacing [ & ] with %5B and %5D respectively.
Thanks, that helped.
-
No problem. to convert it to decimal you could use alphanumeric meta point and in your script do the following.