Tonight I started a small project trying to create a C# library to access the Google Storage API. When you create any kind of request to the Google Storage API, you have to include the "Date" header in the web request.
I tried to create a WebRequest in C#, and noticed that I couldn't set the "Date" header manually. According to this MSDN page, the Date property should be getting set automatically by the system.
My requests to Google are failing though due to a missing "Date" header. Fiddler confirms that a Date header is not being sent in my request.
Here is the code snippet I'm using:
WebRequest webRequest;
webRequest = WebRequest.Create("http://commondatastorage.googleapis.com");
String auth = "GOOG1 " + m_accessKey + ":" + CreateSignature();
webRequest.Headers.Add("Authorization", auth);
webRequest.ContentType = "text/html";
Stream objStream;
objStream = webRequest.GetResponse().GetResponseStream();
Any idea what could be going on? Why isn't the Date header being sent with my web request?