private static void Check(bool ok, string call) | Throws an IOException naming the WinHTTP call if it failed. |
private static string Describe(int code) | Turns a WinHTTP error code into readable text. |
private static int RemainingMs(DateTime deadlineUtc, string url) | Milliseconds left until the deadline; throws a TimeoutException once it has passed. |
private IntPtr Session() | Returns the WinHTTP session, opening it with the automatic proxy first and the default proxy as a fallback. |
private static IOException TooLarge(Uri uri, long maxBytes) | Builds the error for a response over the size limit. |
private static bool WinHttpCloseHandle(IntPtr handle) | P/Invoke into winhttp.dll that closes a handle. |
private static IntPtr WinHttpConnect(IntPtr session, string server, ushort port, uint reserved) | P/Invoke into winhttp.dll that connects to a server and port. |
private static IntPtr WinHttpOpen(string agent, uint accessType, string proxyName, string proxyBypass, uint flags) | P/Invoke into winhttp.dll that opens a session. |
private static IntPtr WinHttpOpenRequest(IntPtr connection, string verb, string objectName, string version, string referrer, IntPtr acceptTypes, uint flags) | P/Invoke into winhttp.dll that opens a request. |
private static bool WinHttpQueryHeaders(IntPtr request, uint infoLevel, IntPtr name, ref uint buffer, ref uint bufferLength, IntPtr index) | P/Invoke into winhttp.dll that reads a response header. |
private static bool WinHttpReadData(IntPtr request, byte[] buffer, uint bytesToRead, out uint bytesRead) | P/Invoke into winhttp.dll that reads response body bytes. |
private static bool WinHttpReceiveResponse(IntPtr request, IntPtr reserved) | P/Invoke into winhttp.dll that waits for the response. |
private static bool WinHttpSendRequest(IntPtr request, IntPtr headers, uint headersLength, IntPtr optional, uint optionalLength, uint totalLength, IntPtr context) | P/Invoke into winhttp.dll that sends a request. |
private static bool WinHttpSetTimeouts(IntPtr handle, int resolveMs, int connectMs, int sendMs, int receiveMs) | P/Invoke into winhttp.dll that sets the resolve, connect, send and receive timeouts. |