C# Класс XenAPI.HTTP

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BuildUri ( string hostname, string path ) : Uri

Build a URI from a hostname, a path, and some query arguments

CONNECT ( Uri uri, IWebProxy proxy, String session, int timeout_ms ) : Stream
ConnectStream ( Uri uri, IWebProxy proxy, bool nodelay, int timeout_ms ) : Stream

This function will connect a stream to a uri (host and port), negotiating proxies and SSL

CopyStream ( Stream inStream, Stream outStream, DataCopiedDelegate progressDelegate, FuncBool cancellingDelegate ) : long
GET ( Uri uri, IWebProxy proxy, int timeout_ms ) : Stream
Get ( DataCopiedDelegate dataCopiedDelegate, FuncBool cancellingDelegate, Uri uri, IWebProxy proxy, string path, int timeout_ms ) : void

A general HTTP GET method, with delegates for progress and cancelling. May throw various exceptions.

PUT ( Uri uri, IWebProxy proxy, long ContentLength, int timeout_ms ) : Stream
Put ( UpdateProgressDelegate progressDelegate, FuncBool cancellingDelegate, Uri uri, IWebProxy proxy, string path, int timeout_ms ) : void

A general HTTP PUT method, with delegates for progress and cancelling. May throw various exceptions.

UseSSL ( Uri uri ) : bool
getResultCode ( string line ) : int

Приватные методы

Метод Описание
ConnectSocket ( Uri uri, bool nodelay, int timeout_ms ) : NetworkStream
DO_HTTP ( Uri uri, IWebProxy proxy, bool nodelay, int timeout_ms ) : Stream
ReadHttpHeaders ( Stream &stream, IWebProxy proxy, bool nodelay, int timeout_ms ) : bool

Read HTTP headers, doing any redirects as necessary

ReadLine ( Stream stream ) : string
ValidateServerCertificate ( object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors ) : bool
WriteLine ( Stream stream ) : void
WriteLine ( String txt, Stream stream ) : void

Описание методов

BuildUri() публичный статический Метод

Build a URI from a hostname, a path, and some query arguments
public static BuildUri ( string hostname, string path ) : Uri
hostname string
path string
Результат System.Uri

CONNECT() публичный статический Метод

public static CONNECT ( Uri uri, IWebProxy proxy, String session, int timeout_ms ) : Stream
uri System.Uri
proxy IWebProxy
session String
timeout_ms int
Результат Stream

ConnectStream() публичный статический Метод

This function will connect a stream to a uri (host and port), negotiating proxies and SSL
public static ConnectStream ( Uri uri, IWebProxy proxy, bool nodelay, int timeout_ms ) : Stream
uri System.Uri
proxy IWebProxy
nodelay bool
timeout_ms int Timeout, in ms. 0 for no timeout.
Результат Stream

CopyStream() публичный статический Метод

public static CopyStream ( Stream inStream, Stream outStream, DataCopiedDelegate progressDelegate, FuncBool cancellingDelegate ) : long
inStream Stream
outStream Stream
progressDelegate DataCopiedDelegate
cancellingDelegate FuncBool
Результат long

GET() публичный статический Метод

public static GET ( Uri uri, IWebProxy proxy, int timeout_ms ) : Stream
uri System.Uri
proxy IWebProxy
timeout_ms int
Результат Stream

Get() публичный статический Метод

A general HTTP GET method, with delegates for progress and cancelling. May throw various exceptions.
public static Get ( DataCopiedDelegate dataCopiedDelegate, FuncBool cancellingDelegate, Uri uri, IWebProxy proxy, string path, int timeout_ms ) : void
dataCopiedDelegate DataCopiedDelegate
cancellingDelegate FuncBool Delegate called periodically to see if need to cancel
uri System.Uri URI to GET from
proxy IWebProxy A proxy to handle the HTTP connection
path string Path to file to receive the data
timeout_ms int Timeout for the connection in ms. 0 for no timeout.
Результат void

PUT() публичный статический Метод

public static PUT ( Uri uri, IWebProxy proxy, long ContentLength, int timeout_ms ) : Stream
uri System.Uri
proxy IWebProxy
ContentLength long
timeout_ms int
Результат Stream

Put() публичный статический Метод

A general HTTP PUT method, with delegates for progress and cancelling. May throw various exceptions.
public static Put ( UpdateProgressDelegate progressDelegate, FuncBool cancellingDelegate, Uri uri, IWebProxy proxy, string path, int timeout_ms ) : void
progressDelegate UpdateProgressDelegate Delegate called periodically (500ms) with percent complete
cancellingDelegate FuncBool Delegate called periodically to see if need to cancel
uri System.Uri URI to PUT to
proxy IWebProxy A proxy to handle the HTTP connection
path string Path to file to put
timeout_ms int Timeout for the connection in ms. 0 for no timeout.
Результат void

UseSSL() публичный статический Метод

public static UseSSL ( Uri uri ) : bool
uri System.Uri
Результат bool

getResultCode() публичный статический Метод

public static getResultCode ( string line ) : int
line string
Результат int