Set or read Date in HTTP header (Windows Phone 8) -
does knows of way set or read 'date' http header in http request on windows phone 8?
i need able set value of date header or @ least read value sent in request.
i have tried like:
var web_request = httpwebrequest.createhttp(url); web_request.headers["date"] = the_date;
but produces exception @ run time: system.argumentexception: 'date' header must modified using appropriate property or method.
there's sample code here httpclient apparently not available under windows phone 8: how set content-type header httpclient request?
i have tried reading date after:
var web_request = httpwebrequest.createhttp(url);
the date not seem set yet.
that worked after adding "microsoft http client libraries". there still problem in library on windowsphone platform.
problem:
i have scenario want add "date" header in specific format, used
string customdate = "11/29/2013 7:46:25"
defaultrequestheaders.tryaddwithoutvalidation("date", customdate);
the above line adds "date" header, means not throw exception, when checked in fidler there no "date" header added. same code works in windows8 store apps.
looks there bug in "microsoft http client libraries" windowsphone8 platform.
Comments
Post a Comment