You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Filippo Balicchia <fi...@gmail.com> on 2010/07/28 20:42:49 UTC

HTTP Component Control to HttpClient

Hello all,
after some test i'd like to know if it possibile to have from camel a
full control of
HttpClient request.

For example if i have http end-point is possible to get the request
end add some header
like ('Content-Type', 'multipart/form-data');


thanks

--Filippo

Re: HTTP Component Control to HttpClient

Posted by Willem Jiang <wi...@gmail.com>.
You can put the RequestEntity into the message body, then HttpProducer 
will use it directly.

Willem

Filippo Balicchia wrote:
> Thanks for the response but
> 
> Is possibile to send a multipart/form-data request ?
> 
> What i want do is the equivalent of
>  Part[] parts = {
>                     new StringPart("transaction-set", "my ransact",
> StringPart.DEFAULT_CONTENT_TYPE),
>                     new StringPart("input-format", "my inputformat ",
> StringPart.DEFAULT_CONTENT_TYPE),
>                     new StringPart("message", "message2",
> StringPart.DEFAULT_CONTENT_TYPE) };
> 
>                 postMethod.setRequestEntity(new
> MultipartRequestEntity(parts, postMethod.getParams()));
> 
> 
> Cheers Filippo
> 
> 2010/7/29 Willem Jiang <wi...@gmail.com>:
>> Hi Filippo,
>>
>> You can set the Content-Type by setting the message header with the key of
>> "Content-Type".
>>
>> Willem
>> ----------------------------------
>> Apache Camel, Apache CXF committer
>> Open Source Integration http://www.fusesource.com
>> Blog http://willemjiang.blogspot.com
>> Tiwtter http://twitter.com/willemjiang
>>
>>
>> Filippo Balicchia wrote:
>>> Hello all,
>>> after some test i'd like to know if it possibile to have from camel a
>>> full control of
>>> HttpClient request.
>>>
>>> For example if i have http end-point is possible to get the request
>>> end add some header
>>> like ('Content-Type', 'multipart/form-data');
>>>
>>>
>>> thanks
>>>
>>> --Filippo
>>>
>>
> 


Re: HTTP Component Control to HttpClient

Posted by Filippo Balicchia <fi...@gmail.com>.
Thanks for the response but

Is possibile to send a multipart/form-data request ?

What i want do is the equivalent of
 Part[] parts = {
                    new StringPart("transaction-set", "my ransact",
StringPart.DEFAULT_CONTENT_TYPE),
                    new StringPart("input-format", "my inputformat ",
StringPart.DEFAULT_CONTENT_TYPE),
                    new StringPart("message", "message2",
StringPart.DEFAULT_CONTENT_TYPE) };

                postMethod.setRequestEntity(new
MultipartRequestEntity(parts, postMethod.getParams()));


Cheers Filippo

2010/7/29 Willem Jiang <wi...@gmail.com>:
> Hi Filippo,
>
> You can set the Content-Type by setting the message header with the key of
> "Content-Type".
>
> Willem
> ----------------------------------
> Apache Camel, Apache CXF committer
> Open Source Integration http://www.fusesource.com
> Blog http://willemjiang.blogspot.com
> Tiwtter http://twitter.com/willemjiang
>
>
> Filippo Balicchia wrote:
>>
>> Hello all,
>> after some test i'd like to know if it possibile to have from camel a
>> full control of
>> HttpClient request.
>>
>> For example if i have http end-point is possible to get the request
>> end add some header
>> like ('Content-Type', 'multipart/form-data');
>>
>>
>> thanks
>>
>> --Filippo
>>
>
>

Re: HTTP Component Control to HttpClient

Posted by Willem Jiang <wi...@gmail.com>.
Hi Filippo,

You can set the Content-Type by setting the message header with the key 
of "Content-Type".

Willem
----------------------------------
Apache Camel, Apache CXF committer
Open Source Integration http://www.fusesource.com
Blog http://willemjiang.blogspot.com
Tiwtter http://twitter.com/willemjiang


Filippo Balicchia wrote:
> Hello all,
> after some test i'd like to know if it possibile to have from camel a
> full control of
> HttpClient request.
> 
> For example if i have http end-point is possible to get the request
> end add some header
> like ('Content-Type', 'multipart/form-data');
> 
> 
> thanks
> 
> --Filippo
>