Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tHttpRequest an tRest : error 400 Bad Request when special character blank space

Hello,

I'm using a tHttpRequest in GET mode. when I send a link without spaces or special characters like "€", it works very well. As soon as there is a space or other special character in my data it returns me a message "400 bad request". When I put the same link on an explorer it goes very well. I also tried with a tRest but I have the same message. I tried to make an URLEncoder.encode in UTF-8, but here it crashes.

Can you help me please ?

Screenshot_1.png

Labels (3)
8 Replies
Anonymous
Not applicable
Author

Any help ?

Anonymous
Not applicable
Author

Hello,

I have almost the same type of error.

I'm trying to send an OData query via tRest component, and have a filter like "CFISCYEAR eq 2018" in my URL.

Because of the spaces I have in this filter, I get a java.lang error : IllegalArgumentException: Illegal character in query at index 146.

 

Any help would be welcome and appreciated 0683p000009MACn.png

Anonymous
Not applicable
Author

Wrap your URL within this code.....

java.net.URLEncoder.encode(yourURL, "UTF-8") 
Anonymous
Not applicable
Author

Thank you for your reply.

Unfortunately, it's not working for me : 

com.sun.jersey.api.client.ClientHandlerException: java.lang.IllegalArgumentException: URI is not absolute

Anonymous
Not applicable
Author

Yours is a completely different issue. Can you raise a new question and include screenshots of your configuration. There is not enough information here.

Anonymous
Not applicable
Author

Anonymous
Not applicable
Author

The Encode function does not work because it will encode anything even the "/"

Anonymous
Not applicable
Author

Yes @Moe I went into more detail here: https://community.talend.com/t5/Design-and-Development/tRest-using-OData-URL-with-blank-space/m-p/11...

 

I was kind of expecting it to be more of a clue than an unquestioned solution, if I am honest. Essentially you need to encode everything that is not a functional part of the URL. This means that in URLs with parameters built in, it may only just be the parameter sections.