Пример #1
0
 /// <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>();
 }
Пример #2
0
        /// <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>();
        }
Пример #3
0
        internal NetworkingModule(ReactContext reactContext)
            : base(reactContext)
        {
            _cookieContainer = new CookieContainer();
            _client          = new DefaultHttpClient(
                new HttpClient(
                    new HttpBaseProtocolFilter
            {
                CookieContainer   = _cookieContainer,
                AllowAutoRedirect = false,
            }));

            _tasks = new TaskCancellationManager <int>();
        }