You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Supun Kamburugamuva <su...@gmail.com> on 2010/02/15 12:04:57 UTC

HTTP Request with no Content-Type header

Does HTTPCore add a content type in case there is no Content-Type header in
the request message?

Thanks,
Supun..

-- 
Software Engineer, WSO2 Inc
http://wso2.org
supunk.blogspot.com

Re: HTTP Request with no Content-Type header

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
BTW this is what the RFC says about this scenario:

*Any HTTP/1.1 message containing an entity-body SHOULD include a
> Content-Type header field defining the media type of that body. If and only
> if the media type is not given by a Content-Type field, the recipient MAY
> attempt to guess the media type via inspection of its content and/or the
> name extension(s) of the URI used to identify the resource. If the media
> type remains unknown, the recipient SHOULD treat it as type
> "application/octet-stream".*


This is what we I have already done for response handling in the NHTTP
transport (and we did it in a configurable manner). Earlier it used to pass
an empty payload to the client when the responses did not have a
Content-Type header. May be we should do the same for the requests?

Thanks,
Hiranya

On Tue, Feb 16, 2010 at 9:49 AM, Hiranya Jayathilaka
<hi...@gmail.com>wrote:

>
>
> On Tue, Feb 16, 2010 at 6:24 AM, Ruwan Linton <ru...@gmail.com>wrote:
>
>> I think Synapse nhttp transport defaults to application/octet-stream which
>> will result in the message to be built as binary, I think Hiranya did some
>> fix around this sometime back, Hiranya*??
>> *
>
>
> Nope. That was for responses only.
>
> Thanks,
> Hiranya
>
>
>> *
>> Thanks,
>> Ruwan
>> *
>>
>> On Mon, Feb 15, 2010 at 5:22 PM, Asankha C. Perera <as...@apache.org>wrote:
>>
>>> Supun Kamburugamuva wrote:
>>> > Does HTTPCore add a content type in case there is no Content-Type
>>> > header in the request message?
>>> No, I do not think it should either
>>>
>>> cheers
>>> asankha
>>>
>>> --
>>> Asankha C. Perera
>>> AdroitLogic, http://adroitlogic.org
>>>
>>> http://esbmagic.blogspot.com
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>
>>>
>>
>>
>> --
>> Ruwan Linton
>> Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
>>
>> WSO2 Inc.; http://wso2.org
>> email: ruwan@wso2.com; cell: +94 77 341 3097
>> blog: http://ruwansblog.blogspot.com
>>
>
>
>
> --
> Hiranya Jayathilaka
> Software Engineer;
>
> WSO2 Inc.;  http://wso2.org
> E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>



-- 
Hiranya Jayathilaka
Software Engineer;
WSO2 Inc.;  http://wso2.org
E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com

Re: HTTP Request with no Content-Type header

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
On Tue, Feb 16, 2010 at 6:24 AM, Ruwan Linton <ru...@gmail.com>wrote:

> I think Synapse nhttp transport defaults to application/octet-stream which
> will result in the message to be built as binary, I think Hiranya did some
> fix around this sometime back, Hiranya*??
> *


Nope. That was for responses only.

Thanks,
Hiranya


> *
> Thanks,
> Ruwan
> *
>
> On Mon, Feb 15, 2010 at 5:22 PM, Asankha C. Perera <as...@apache.org>wrote:
>
>> Supun Kamburugamuva wrote:
>> > Does HTTPCore add a content type in case there is no Content-Type
>> > header in the request message?
>> No, I do not think it should either
>>
>> cheers
>> asankha
>>
>> --
>> Asankha C. Perera
>> AdroitLogic, http://adroitlogic.org
>>
>> http://esbmagic.blogspot.com
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>
>
> --
> Ruwan Linton
> Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
>
> WSO2 Inc.; http://wso2.org
> email: ruwan@wso2.com; cell: +94 77 341 3097
> blog: http://ruwansblog.blogspot.com
>



-- 
Hiranya Jayathilaka
Software Engineer;
WSO2 Inc.;  http://wso2.org
E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com

Re: HTTP Request with no Content-Type header

Posted by Ruwan Linton <ru...@gmail.com>.
I think Synapse nhttp transport defaults to application/octet-stream which
will result in the message to be built as binary, I think Hiranya did some
fix around this sometime back, Hiranya*??

Thanks,
Ruwan
*
On Mon, Feb 15, 2010 at 5:22 PM, Asankha C. Perera <as...@apache.org>wrote:

> Supun Kamburugamuva wrote:
> > Does HTTPCore add a content type in case there is no Content-Type
> > header in the request message?
> No, I do not think it should either
>
> cheers
> asankha
>
> --
> Asankha C. Perera
> AdroitLogic, http://adroitlogic.org
>
> http://esbmagic.blogspot.com
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>


-- 
Ruwan Linton
Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: ruwan@wso2.com; cell: +94 77 341 3097
blog: http://ruwansblog.blogspot.com

Re: HTTP Request with no Content-Type header

Posted by "Asankha C. Perera" <as...@apache.org>.
Supun Kamburugamuva wrote:
> Does HTTPCore add a content type in case there is no Content-Type
> header in the request message?
No, I do not think it should either

cheers
asankha

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org