I'm doing a communication program with apis online and I'm using a header of type DateTime
and I needed that date to be in type ISO 8601
how can I do that?
I'm using this to create the header:
var tempo = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ");
var httpWebRequest = (HttpWebRequest)WebRequest.Create("teste");
httpWebRequest.Headers.Add("Date"+ tempo);
The output is this:
Date2017-09-08T15: 25: 53Z
I wanted it to be this:
Date: 2017-09-08T15: 25: 53Z