HttpRequestHeaders, Content-Type missing?

Topics: Web Api
Dec 5, 2011 at 3:35 PM

Hi,

Is the HttpRequestHeaders class losing the Content-Type header value on incoming POSTs?

I have an HttpOperationHandler that looks at the HttpRequestMessage.Headers collection. It seems that the Content-Type, despite being sent by the client during the request, is never parsed into the HttpRequestHeaders collection.

Also, examining the source code static ctor for HttpRequestHeaders, it doesn't include HttpKnownHeaderNames.ContentType.

Is this right? Apologies if I'm missing something! I'm using the new Preview 0.6.0 binaries.

Thanks,

Andrew

p.s. keep up the good work; it's an excellent library.

Coordinator
Dec 5, 2011 at 3:42 PM
HttpContent has headers. Check the Content.Headers property.

Sent from my Windows Phone

From: Riscy
Sent: 12/5/2011 7:36 AM
To: Glenn Block
Subject: HttpRequestHeaders, Content-Type missing? [wcf:281853]

From: Riscy

Hi,

Is the HttpRequestHeaders class losing the Content-Type header value on incoming POSTs?

I have an HttpOperationHandler that looks at the HttpRequestMessage.Headers collection. It seems that the Content-Type, despite being sent by the client during the request, is never parsed into the HttpRequestHeaders collection.

Also, examining the source code static ctor for HttpRequestHeaders, it doesn't include HttpKnownHeaderNames.ContentType.

Is this right? Apologies if I'm missing something! I'm using the new Preview 0.6.0 binaries.

Thanks,

Andrew

p.s. keep up the good work; it's an excellent library.

Dec 5, 2011 at 3:53 PM

Many apologies - that works fine.

Thanks

Coordinator
Dec 5, 2011 at 4:00 PM
No need to apologize :-)

Sent from my Windows Phone

From: Riscy
Sent: 12/5/2011 7:54 AM
To: Glenn Block
Subject: Re: HttpRequestHeaders, Content-Type missing? [wcf:281853]

From: Riscy

Many apologies - that works fine.

Thanks