Example #1
0
 /// <summary>
 /// Deauthenticates this instance, disposing of the Auth token.
 /// </summary>
 /// <returns></returns>
 public async Task Deauthenticate()
 {
     if (DefaultHeaders.ContainsKey(HeaderAuthorization))
     {
         DefaultHeaders.Remove(HeaderAuthorization);
     }
 }
Example #2
0
        public void can_set_default_values_for_headers()
        {
            Get("/info").Body.ShouldNotContain("Header: CONTENT_TYPE = application/json");

            DefaultHeaders.Add("Content-Type", "application/json");
            Get("/info").Body.ShouldContain("Header: CONTENT_TYPE = application/json");

            DefaultHeaders.Remove("Content-Type");
            Get("/info").Body.ShouldNotContain("Header: CONTENT_TYPE = application/json");
        }