Today I started a small project trying to create a C # library to access the Google Storage API . When you make any request to the Google Storage API, you must include the Date header in the web request.
I tried creating a WebRequest in C # and noticed that I cannot set the Date header manually. According to this MSDN page , the Date property should be automatically set by the system.
My requests to Google are not fulfilled, although due to the lack of a Date heading. Fiddler confirms that the date header is not 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();
, ? Date -?