You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Jay mann (JIRA)" <ji...@apache.org> on 2016/05/18 00:44:12 UTC
[jira] [Commented] (CAMEL-9651) Restlet consumer request fails if
there is a space '%20' in the url
[ https://issues.apache.org/jira/browse/CAMEL-9651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15287975#comment-15287975 ]
Jay mann commented on CAMEL-9651:
---------------------------------
Opened PR #986
> Restlet consumer request fails if there is a space '%20' in the url
> -------------------------------------------------------------------
>
> Key: CAMEL-9651
> URL: https://issues.apache.org/jira/browse/CAMEL-9651
> Project: Camel
> Issue Type: Bug
> Components: camel-restlet
> Affects Versions: 2.16.2
> Reporter: Jay mann
> Attachments: patch.txt
>
>
> Consuming a restful service using restlet component fails with URISyntaxException if there is a special character or space in the URL.
> To fix this org.apache.camel.component.restlet.RestletComponent should:
> {code}
> @Override
> public boolean useRawUri() {
> // should use encoded uri by default
> return true;
> }
> {code}
> Simple example of failure:
> {code}
> rest("/Utils")
> .description("Camel Utilities Rest Service")
> .consumes("application/json").produces("application/json")
> .get("test/testme").route().log("Got HEre").
> to("restlet:http://localhost:8299/Utils/test2/TEST%20Name?throwExceptionOnFailure=false&restletMethod=GET")
> .getRestDefinition()
> .get("test2/{name2}").route().log("GOt ${header.name2}");
> {code}
> If you remove the space it works fine.
> {code}
> Caused by: java.net.URISyntaxException: Illegal character in path at index 38: http://localhost:8299/Utils/test2/TEST Name
> at java.net.URI$Parser.fail(URI.java:2848)
> at java.net.URI$Parser.checkChars(URI.java:3021)
> at java.net.URI$Parser.parseHierarchical(URI.java:3105)
> at java.net.URI$Parser.parse(URI.java:3053)
> at java.net.URI.<init>(URI.java:588)
> at org.apache.camel.component.restlet.RestletComponent.createEndpoint(RestletComponent.java:120)
> at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:114)
> at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:570)
> {code}
> It seems like there are lots of bugs with restlet component, What is the most mature service for consuming restful/http services?
> Thanks.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)