Thanks for your response Mike,
For the HTTPwebRequest, I'm afraid the current implementation has hidden
the Date Header's generation internally and dosn't expose any means for us
to intercepting the header collection. If you do need to manually involve
such custom headers in your HTTP communication(base on the RFC of HTTP 1.1
, date header is not required in client request message), I think we may
need to write our own HTTP message/header generating class rather than use
the HttpWebRequest, also I don't think derived class from it can intercept
the header generation.
Thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Mike Koerner" <mi**********@newsgroup.nospam>
| References: <#U**************@TK2MSFTNGP09.phx.gbl>
<33*************@TK2MSFTNGXA01.phx.gbl>
| Subject: Re: HTTPWebRequest Date Header
| Date: Mon, 19 Sep 2005 08:50:15 -0700
| Lines: 83
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
| X-RFC2646: Format=Flowed; Original
| Message-ID: <#g**************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 12.175.2.2
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:125559
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi,
|
| Thanks for the response. I understand that the Date header is assigned
at
| runtime. Is there a way to include it in the headers sent by
| HTTPWebRequest? It is not currently being sent. Do I have to create a
| class derived from HTTPWebRequest to send it?
|
| Thanks,
| Mike
|
|
| "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| news:33*************@TK2MSFTNGXA01.phx.gbl...
| > Hi Mike,
| >
| > Welcome to ASPNET newsgroup.
| > As for the "Date" http header you mentioned, based on the
HttpWebRequest's
| > Documentation, it is not included in the headers collection , also
there
| > is
| > no property in the HttpWebRequest class for us to manually adjust it
since
| > it is automatically assigned to the current Date by runtime.
| >
| > #HttpWebRequest.Headers Property
| >
http://msdn.microsoft.com/library/de...us/cpref/html/
| > frlrfsystemnethttpwebrequestclassheaderstopic.asp
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure!
www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| >
| > --------------------
| > | From: "Mike Koerner" <mi**********@newsgroup.nospam>
| > | Subject: HTTPWebRequest Date Header
| > | Date: Fri, 16 Sep 2005 15:58:48 -0700
| > | Lines: 19
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
| > | X-RFC2646: Format=Flowed; Original
| > | Message-ID: <#U**************@TK2MSFTNGP09.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: 12.175.2.2
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:125237
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Hi,
| > |
| > | I am having problems setting the HttpWebRequest Date header. I
| > understand
| > | that it is a restricted header and I do receive the
| > | "This header must be modified with the appropriate property." Is
there
| > a
| > | way to make sure that the date header is sent over or a way to work
| > around
| > | this exception?
| > |
| > | Here's a sample of the code:
| > |
| > | System.Net.HttpWebRequest wr;
| > | wr = (HttpWebRequest)WebRequest.Create(requestUrl);
| > | System.Net.WebHeaderCollection whcHeaders = wr.Headers;
| > | whcHeaders.Add(@"Date" , DateTime.Now.ToString("r"));
| > |
| > | Thanks,
| > | Mike
| > |
| > |
| > |
| >
|
|
|