protected void SetAllowInvalidSSLCertificates(HTTPClient client) { uint connectionID = client.ConnectionID; Bindings._URLClientSetAllowInvalidSSLCertificate( connectionID, allowInvalidSSLCertificates); }
protected HTTPHeaderList CreateHeaders(HTTPClient client) { uint connectionID = client.ConnectionID; HTTPHeaderList headers = new HTTPHeaderList(); string name, value; // read headers for (uint i = 0; i < (uint)int.MaxValue; ++i) { name = Bindings._URLClientGetResponseHeaderName(connectionID, i); if (name == null) { break; } value = Bindings._URLClientGetResponseHeaderValue(connectionID, i); if (value == null) { break; } headers[name] = value; } return(headers); }
public virtual HTTPResponse OnDidUpdate(HTTPClient client, HTTPResponse response) { if (client.State < ConnectionState.ReceivingData) { return(response); } if (response == null) { response = CreateResponse(client); } while (true) { UpdateContentData(client, response); if (CheckNeedsResponseReset(client) == false) { break; } response = ResetResponse(client, response); } return(response); }
protected override HTTPResponse ResetResponse(HTTPClient client, HTTPResponse response) { response = base.ResetResponse(client, response); CreateStream(response); return response; }
protected override HTTPResponse CreateResponse(HTTPClient client) { HTTPResponse response = base.CreateResponse(client); response.supportsContentMemoryStream = true; return(response); }
protected override HTTPResponse CreateResponse(HTTPClient client) { HTTPResponse response = base.CreateResponse(client); response.supportsContentFilePath = true; response.contentFilePath = _destinationPath; return response; }
public override void OnWillSendRequest(HTTPClient client) { base.OnWillSendRequest(client); uint connectionID = client.ConnectionID; Bindings._URLClientSetRequestContentSource(connectionID, _sourcePath); }
protected void SetAllowFollowRedirects(HTTPClient client) { uint connectionID = client.ConnectionID; Bindings._URLClientSetAllowFollowRedirects( connectionID, allowFollowRedirects, maxRedirectCount); }
protected override HTTPResponse ResetResponse(HTTPClient client, HTTPResponse response) { response = base.ResetResponse(client, response); CreateStream(response); return(response); }
protected override void UpdateContentData(HTTPClient client, HTTPResponse response) { uint connectionID = client.ConnectionID; response.receivedContentLength = Bindings._URLClientGetResponseContentLengthRead(connectionID); }
protected virtual bool CheckNeedsResponseReset(HTTPClient client) { uint connectionID = client.ConnectionID; bool isDirty = Bindings._URLClientCheckAndResetResponseDirtyFlag(connectionID); return(isDirty); }
protected override HTTPResponse CreateResponse(HTTPClient client) { HTTPResponse response = base.CreateResponse(client); response.supportsContentFilePath = true; response.contentFilePath = _destinationPath; return(response); }
public override void OnWillSendRequest(HTTPClient client) { base.OnWillSendRequest(client); uint connectionID = client.ConnectionID; Bindings.URLClientSetRequestContent(connectionID, _bytes, (ulong)_bytes.Length); }
protected void SetAcceptableStatusCodes(HTTPClient client) { uint connectionID = client.ConnectionID; if (acceptableStatusCodeRanges != null) { foreach (HTTPStatusCodeRange range in acceptableStatusCodeRanges) { Bindings._URLClientAddAcceptableResponseStatusCodeRange( connectionID, range.fromCode, range.toCode); } } }
public override void OnWillSendRequest(HTTPClient client) { if (_allowResume == true) { AddAcceptableStatusCode(200); AddAcceptableStatusCode(206); AddAcceptableStatusCode(416); } base.OnWillSendRequest(client); uint connectionID = client.ConnectionID; Bindings._URLClientSetResponseContentDestination(connectionID, _destinationPath, _allowResume); }
protected virtual HTTPResponse CreateResponse(HTTPClient client) { uint connectionID = client.ConnectionID; HTTPResponse response = new HTTPResponse(); response.statusCode = Bindings._URLClientGetResponseStatusCode(connectionID); response.resumedContentLength = Bindings._URLClientGetResponseContentLengthResumed(connectionID); response.expectedReceiveContentLength = Bindings._URLClientGetResponseContentExpectedLength(connectionID); response.redirectCount = Bindings._URLClientGetResponseRedirectCount(connectionID); response.headers = CreateHeaders(client); return(response); }
public virtual bool OnWillStart(HTTPClient client) { return(true); }
public override bool OnWillStart(HTTPClient client) { return (string.IsNullOrEmpty(_destinationPath) == false); }
public virtual void OnWillSendRequest(HTTPClient client) { }
public virtual bool OnWillStart(HTTPClient client) { return true; }
protected abstract void UpdateContentData(HTTPClient client, HTTPResponse response);
protected override HTTPResponse CreateResponse(HTTPClient client) { HTTPResponse response = base.CreateResponse(client); response.supportsContentStream = true; return response; }
public override bool OnWillStart(HTTPClient client) { return(string.IsNullOrEmpty(_destinationPath) == false); }
protected HTTPHeaderList CreateHeaders(HTTPClient client) { uint connectionID = client.ConnectionID; HTTPHeaderList headers = new HTTPHeaderList(); string name, value; // read headers for (uint i = 0; i < (uint)int.MaxValue; ++i) { name = Bindings._URLClientGetResponseHeaderName(connectionID, i); if (name == null) { break; } value = Bindings._URLClientGetResponseHeaderValue(connectionID, i); if (value == null) { break; } headers[name] = value; } return headers; }
public virtual void OnWillSendRequest(HTTPClient client) { SetAllowFollowRedirects(client); SetAcceptableStatusCodes(client); SetAllowInvalidSSLCertificates(client); }
protected virtual HTTPResponse ResetResponse(HTTPClient client, HTTPResponse response) { response = CreateResponse(client); return(response); }
public override bool OnWillStart(HTTPClient client) { return(_bytes != null); }
protected virtual bool CheckNeedsResponseReset(HTTPClient client) { uint connectionID = client.ConnectionID; bool isDirty = Bindings._URLClientCheckAndResetResponseDirtyFlag(connectionID); return isDirty; }
protected virtual HTTPResponse ResetResponse(HTTPClient client, HTTPResponse response) { response = CreateResponse(client); return response; }
public virtual HTTPResponse OnDidUpdate(HTTPClient client, HTTPResponse response) { if (client.State < ConnectionState.ReceivingData) { return response; } if (response == null) { response = CreateResponse(client); } while (true) { UpdateContentData(client, response); if (CheckNeedsResponseReset(client) == false) { break; } response = ResetResponse(client, response); } return response; }
protected virtual HTTPResponse CreateResponse(HTTPClient client) { uint connectionID = client.ConnectionID; HTTPResponse response = new HTTPResponse(); response.statusCode = Bindings._URLClientGetResponseStatusCode(connectionID); response.resumedContentLength = Bindings._URLClientGetResponseContentLengthResumed(connectionID); response.expectedReceiveContentLength = Bindings._URLClientGetResponseContentExpectedLength(connectionID); response.redirectCount = Bindings._URLClientGetResponseRedirectCount(connectionID); response.headers = CreateHeaders(client); return response; }
public override bool OnWillStart(HTTPClient client) { return (_bytes != null); }