private static CreateWebClient ( IOConnectionInfo ioc ) : |
||
ioc | IOConnectionInfo | |
Résultat |
public override void Close() { base.Close(); WebRequest testReq = WebRequest.Create(ioc.Path); if (testReq is HttpWebRequest) { RepeatWithDigestOnFail(ioc, req => { req.Headers.Add("Translate: f"); if (method != null) { req.Method = method; } var data = this.ToArray(); using (Stream s = req.GetRequestStream()) { s.Write(data, 0, data.Length); req.GetResponse(); s.Close(); } }); } else { try { uploadData(IOConnection.CreateWebClient(ioc, false)); } catch (WebException ex) { //todo: does this make sense for FTP at all? Remove? if ((ex.Response is HttpWebResponse) && (((HttpWebResponse)ex.Response).StatusCode == HttpStatusCode.Unauthorized)) { uploadData(IOConnection.CreateWebClient(ioc, true)); } else { throw; } } } }