System.Net.FileWebRequest.CheckAndMarkAsyncGetRequestStreamPending C# (CSharp) Method

CheckAndMarkAsyncGetRequestStreamPending() private method

private CheckAndMarkAsyncGetRequestStreamPending ( ) : void
return void
        private void CheckAndMarkAsyncGetRequestStreamPending()
        {
            if (Aborted)
            {
                throw CreateRequestAbortedException();
            }

            if (string.Equals(_method, "GET", StringComparison.OrdinalIgnoreCase) ||
                string.Equals(_method, "HEAD", StringComparison.OrdinalIgnoreCase))
            {
                throw new ProtocolViolationException(SR.net_nouploadonget);
            }

            if (_response != null)
            {
                throw new InvalidOperationException(SR.net_reqsubmitted);
            }

            lock (this)
            {
                if (_writePending)
                {
                    throw new InvalidOperationException(SR.net_repcall);
                }
                _writePending = true;
            }
        }