public IClientResponse Send() { _request.ContentType = _entity.ContentType.ToString(); RaiseStatusChanged("Connecting to {0}", RequestUri.ToString()); if (_entity.Stream != null && ((_entity.Stream.CanSeek && _entity.Stream.Length > 0) || _entity.Stream != _emptyStream)) { SendRequestStream(); } var response = new HttpWebResponseBasedResponse(this, _request); var exceptions = new List <Exception>(); foreach (var handler in _handlers.Where(x => x.Key(response)).Select(x => x.Value)) { try { handler(response); } catch (Exception e) { exceptions.Add(e); } } response.HandlerErrors = exceptions; return(response); }
public IClientResponse Send() { _request.ContentType = _entity.ContentType.ToString(); RaiseStatusChanged("Connecting to {0}", RequestUri.ToString()); if (_entity.Stream != null && ((_entity.Stream.CanSeek && _entity.Stream.Length > 0) || _entity.Stream != _emptyStream)) SendRequestStream(); var response = new HttpWebResponseBasedResponse(this, _request); var exceptions = new List<Exception>(); foreach (var handler in _handlers.Where(x => x.Key(response)).Select(x => x.Value)) { try { handler(response); } catch (Exception e) { exceptions.Add(e); } } response.HandlerErrors = exceptions; return response; }