/// <summary> /// Instantiates the <see cref="NetworkingModule"/>. /// </summary> /// <param name="client">The HTTP client.</param> /// <param name="reactContext">The context.</param> internal NetworkingModule(IHttpClient client, ReactContext reactContext) : base(reactContext) { _instance = this; _client = client; _tasks = new TaskCancellationManager <int>(); }
/// <summary> /// Instantiates the <see cref="NetworkingModule"/>. /// </summary> /// <param name="client">The HTTP client.</param> /// <param name="reactContext">The context.</param> public NetworkingModule(IHttpClient client, ReactContext reactContext) : base(reactContext) { #if !WINDOWS_UWP ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; #endif ServicePointManager.Expect100Continue = false; _client = client; _tasks = new TaskCancellationManager <int>(); }
internal NetworkingModule(ReactContext reactContext) : base(reactContext) { _cookieContainer = new CookieContainer(); _client = new DefaultHttpClient( new HttpClient( new HttpBaseProtocolFilter { CookieContainer = _cookieContainer, AllowAutoRedirect = false, })); _tasks = new TaskCancellationManager <int>(); }