tRest using URL with json object: error Illegal character in query at

One Star

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,
Community Manager

Re: tRest using URL with json object: error Illegal character in query at

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
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: tRest using URL with json object: error Illegal character in query at

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.
Community Manager

Re: tRest using URL with json object: error Illegal character in query at

where is your screenshot? Do you have compilation error in the job generated code? Click the Code tab and see if there exist compilation error?
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: tRest using URL with json object: error Illegal character in query at

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
Community Manager

Re: tRest using URL with json object: error Illegal character in query at

Hi 
Can you paste the full URL? or export the job and send it to via email?
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: tRest using URL with json object: error Illegal character in query at

Hi, 
I send you an email to your following email address : shong@talend.com

Thank you in advance,
Ahmed
One Star

Re: tRest using URL with json object: error Illegal character in query at

Hi,
I sent out the e-mail. 
Any feedbacks?
Thanks in advance
A
One Star

Re: tRest using URL with json object: error Illegal character in query at

Hi, 
As i didn't get answer, should you assume that's impossible to use a url with } ] characters...?
Thanks a lot for your reply,
Best regards,
A