public HTTPRequest(string url, HTTPHeaderList headers = null) { method = "GET"; SetURL(url); if (headers == null) { headers = new HTTPHeaderList(); } authUser = null; authPassword = null; contentHandler = null; }
public HTTPClient(string url, string destinationPath, bool allowResume = true, HTTPHeaderList headers = null) : this(new HTTPRequest(url, headers)) { _responseHandler = new HTTPResponseDownloadHandler(destinationPath, allowResume); }
public HTTPClient(string url, HTTPHeaderList headers = null) : this(new HTTPRequest(url, headers)) { }
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 HTTPResponse() { statusCode = (long)0; receivedContentLength = (ulong)0; resumedContentLength = (ulong)0; expectedReceiveContentLength = (long)-1; supportsContentStream = false; contentStream = null; supportsContentMemoryStream = false; supportsContentFilePath = false; contentFilePath = null; headers = null; }
public HTTPRequest SetHeader(string name, string value) { if (headers == null) { headers = new HTTPHeaderList(); } headers[name] = value; return this; }