You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Justin Heesemann (JIRA)" <ji...@apache.org> on 2017/08/15 11:22:01 UTC

[jira] [Commented] (CAMEL-11671) camel-ahc - No way to disable url encoding

    [ https://issues.apache.org/jira/browse/CAMEL-11671?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16127091#comment-16127091 ] 

Justin Heesemann commented on CAMEL-11671:
------------------------------------------

actually there might be an even simpler way:
instead of 
{{client.prepareRequest(request).execute(new AhcAsyncHandler(exchange, callback, request.getUrl(), getEndpoint().getBufferSize()));}}

why dont we do
{{client.executeRequest(request, new AhcAsyncHandler(exchange, callback, request.getUrl(), getEndpoint().getBufferSize()));}}

> camel-ahc - No way to disable url encoding
> ------------------------------------------
>
>                 Key: CAMEL-11671
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11671
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-ahc
>    Affects Versions: 2.19.1
>            Reporter: Justin Heesemann
>
> There currently seems to be now way to really disable url encoding for ahc urls with query parameters.
> I even tried to use my own ahc binding.
> The problem seems to be, that the AhcProducer uses this section:
> {code}
>  public boolean process(Exchange exchange, AsyncCallback callback) {
>         try {
>             // AHC supports async processing
>             Request request = getEndpoint().getBinding().prepareRequest(getEndpoint(), exchange);
>             log.debug("Executing request {} ", request);
>             client.prepareRequest(request).execute(new AhcAsyncHandler(exchange, callback, request.getUrl(), getEndpoint().getBufferSize()));
>             return false;
>         } catch (Exception e) {
>             exchange.setException(e);
>             callback.done(true);
>             return true;
>         }
>     }
> {code}
> By calling {{client.prepareRequest(request)}} the already created request will be turned again into a request builder with enabled url encoding.
> From my perspective this makes no sense:
> # we could already return a request builder from the AhcBinding, which would save us some processing time
> # the settings on this request builder would then not be overriden 
> But I can see this would be a breaking change in the API of the AhcBinding.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)