Mensaje
General information
Foro:
ASP.NET
Category:
Common Language Runtime
Environment versions
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
ID de la conversación:
01643645
ID del mensaje:
01643750
Views:
26
>Did you configure for https OK.
>
>The request header is being displayed in your screen shot (on the Headers tab). Other tabs will give you other views of the request. Looking at the response should also give you detail of the response.
>You can filter which requests are shown to make it easier to identify those of interest.

I didn't configure for https - it was asking me about certificate and I am not sure I should accept it - do you think I should go ahead and accept everything?

Also, do you think I should add anything extra to my headers (say, specify no-cache, etc.)?

Here is what I have right now:
private void SetRequestHeaders(string tcHost, string tcUserName, string tcPassword, int tnTimeout, int tnRetries)
        {
            client.DefaultRequestHeaders.Accept.Clear();
            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            client.BaseAddress = new Uri(tcHost);
            client.DefaultRequestHeaders.Authorization =
                        new AuthenticationHeaderValue(
        "Basic",
        Convert.ToBase64String(
            System.Text.ASCIIEncoding.ASCII.GetBytes(
                string.Format("{0}:{1}", tcUserName, tcPassword))));

            client.DefaultRequestHeaders.CacheControl = new CacheControlHeaderValue() { MaxAge = TimeSpan.Zero };
            client.Timeout = TimeSpan.FromSeconds( tnTimeout);
        }
just added a line about CacheControl.
If it's not broken, fix it until it is.


My Blog
Previous
Responder
Mapa
Ver