camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Heudecker <nheudec...@gmail.com>
Subject Re: Reading Binary Files and Passing to HTTP Component
Date Sun, 20 Jun 2010 23:58:13 GMT
https://issues.apache.org/activemq/browse/CAMEL-2833

Patch included.

On Sat, Jun 19, 2010 at 2:46 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:

> On Sat, Jun 19, 2010 at 9:58 AM, Willem Jiang <willem.jiang@gmail.com>
> wrote:
> > Hi,
> >
> > I don't think current camel-http support the multipart/form-data out of
> box,
> > as the HttpProducer will try to turn message body into an input stream if
> > the http method is POST.
> >
>
> Ah yeah we should most likely support FileRequestEntity and
> InputStreamRequestEntity out of the box.
>
> We should most likely do something like
>
> If body is file based -> FileRequestEntity
> If body is String based -> StringRequestEntity (only check body
> instanceof String, to avoid type converting as anything can be
> converted into String)
> Else fallback to the InputStreamRequestEntity
>
> I wonder for the file based that people may want to read the content
> of the file and send that instead?
> For that they can use the .convertBodyTo(String.class) in the DSL
> before hitting the to http.
> But we could also offer an option to set which request entity
> preferred, just as we can do that with JMS.
>
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message