Home Dashboard Directory Help
Search

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


Status: 

Closed
 as By Design Help for as By Design


1
0
Sign in
to vote
Type: Bug
ID: 776389
Opened: 1/11/2013 5:27:45 PM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

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
Details
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)
Sign in to post a workaround.