tRest using URL with json object: error Illegal character in query at
Hi All; I'm very new to Talend. and first, thanks for the forum it's really helpful. I'm really stuck, I'm using the tREST component with an URL. The URL contains json data format example : {"analytics":,"options":{"from":"2015-05-18 00:00:00","to":"2015-05-25 17:46:22","utc_offset":2,"range":"daily"}}&export=1 But i'm having always this error : Illegal character in query at index ... it seems that it doesn't like [ et { ... characters ... Could anyone help please ? Thanks Best regards,
Hi
Try to escape the special characters " included in the URL, for example:
"http://localhost:8088/data={\"name:shong\"}"
If it doesn't still work, please upload a screenshot of component settings.
BR
Shong
Thanks for your quick reply. I already escaped all the "Characters" in the URL. I think that what's causing problem is the fact to have the following i attached the screenshots. Thank you for your help.
Here is the errors i got : ( PS : i'm not able to attached screenshot )thanks a lots
Exception in component tREST_1
java.lang.IllegalArgumentException: Illegal character in query at index 94: {"analytics":,"options":{"from":"2015-05-18 00:00:00","to":"2015-05-25 17:46:22","utc_offset":2,"range":"daily"}}&export=1&feeds=43c056de-548b-11e4-9cf0-782bcb074bd1
at java.net.URI.create(URI.java:859)
at com.sun.jersey.api.client.Client.resource(Client.java:402)
at test_alg.trest_extract_0_1.trest_extract.tREST_1Process(trest_extract.java:725)
at test_alg.trest_extract_0_1.trest_extract.tLibraryLoad_1Process(trest_extract.java:391)
at test_alg.trest_extract_0_1.trest_extract.runJobInTOS(trest_extract.java:1103)
at test_alg.trest_extract_0_1.trest_extract.main(trest_extract.java:956)
Caused by: java.net.URISyntaxException: Illegal character in query at index 94: {"analytics":,"options":{"from":"2015-05-18 00:00:00","to":"2015-05-25 17:46:22","utc_offset":2,"range":"daily"}}&export=1&feeds=43c056de-548b-11e4-9cf0-782bcb074bd1
at java.net.URI$Parser.fail(URI.java:2829)
at java.net.URI$Parser.checkChars(URI.java:3002)
at java.net.URI$Parser.parseHierarchical(URI.java:3092)
at java.net.URI$Parser.parse(URI.java:3034)
at java.net.URI.<init>(URI.java:595)
at java.net.URI.create(URI.java:857)
... 5 more