HttpWebRequest request.Date Not Does not honor string format - by lwoodb

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


1
0
Sign in
to vote
ID 776389 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 1/11/2013 5:27:45 PM
Access Restriction Public

Description

The HttpWebRequest request.Date header can be only get modified in .NET Framework 4 and according to the documentation, the System.Net namespace will always write this header as standard form using GMT (UTC) format. So, whatever you can do to format your date as you want, won't work!

In other .NET framework versions you won't be able to modify the HttpWebRequest request.Date header because it will use the actual date in correct GMT (UTC) format unless you use a kind of hack to set your own date and format 

Full detail here
http://stackoverflow.com/questions/11497177/c-sharp-httpwebrequest-date-header-formatting
Sign in to post a comment.
Posted by Microsoft on 6/3/2013 at 12:55 PM
As you've noticed, the HttpWebRequest header is a DateTime object, not a string. As a result, the parsing you're doing won't do anything useful; you're constructing a specific string, and then carefully parsing it, but what you end up with is a DateTime object.

Per the comments on StackOverflow, you might try setting the x-amx-date value instead.
Posted by Microsoft on 1/13/2013 at 11:16 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 1/11/2013 at 5:51 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)