public static HttpRequestMessage GetRequest(this RequestBuilder requestBuilder) { var req = typeof(RequestBuilder).GetField("_req", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); return((HttpRequestMessage)req.GetValue(requestBuilder)); }
public static Task <HttpResponseMessage> PutAsync(this RequestBuilder builder) { return(builder.SendAsync(HttpMethods.Put)); }
/// <summary> /// Get the header string for the provided claims /// </summary> /// <param name="requestBuilder">The requestBuilder instance</param> /// <param name="claims">The claims collection that represents the user identity</param> /// <returns></returns> public static string GetHeaderForIdentity(this RequestBuilder requestBuilder, IEnumerable <Claim> claims) { return(requestBuilder.GetHeaderForIdentity( claims, TestServerDefaults.AuthenticationScheme)); }
public static Task <HttpResponseMessage> DeleteAsync(this RequestBuilder requestBuilder) { return(requestBuilder.SendAsync(HttpMethods.Delete)); }
/// <summary> /// Adds an Authentication header to the <see cref="RequestBuilder"/> with the provided claims using /// "TestServer" as authentication scheme. /// </summary> /// <param name="requestBuilder">The requestBuilder instance</param> /// <param name="claims">The claims collection that represents the user identity</param> /// <returns></returns> public static RequestBuilder WithIdentity(this RequestBuilder requestBuilder, IEnumerable <Claim> claims) { return(requestBuilder.WithIdentity( claims, TestServerDefaults.AuthenticationScheme)); }