/// <summary> /// Request for content (POST) /// </summary> /// <param name="url"></param> /// <param name="postData"></param> /// <param name="callback"></param> public static void UploadString( string url, List<KeyValuePair<string, string>> postData, RequestDoneCallback callback ) { TaskPool.Instance.Request( url, HttpMethod.Post, postData, new HttpRequestCallback( ( isOk, result, errResult ) => { callback( isOk, result, errResult ); } ) ); }
/// <summary> /// Request for content (GET) /// </summary> /// <param name="url"></param> /// <param name="callback"></param> public static void DownloadString( string url, RequestDoneCallback callback ) { TaskPool.Instance.Request( url, HttpMethod.Get, null, new HttpRequestCallback( ( isOk, result, errResult ) => { callback( isOk, result, errResult ); } ) ); }
/// <summary> /// Upload a file /// </summary> /// <param name="url"></param> /// <param name="postData"></param> /// <param name="fileData"></param> /// <param name="fileName"></param> /// <param name="callback"></param> public static void UploadFile( string url, List<KeyValuePair<string, string>> postData, byte[] fileData, string fileFieldName, string fileName, RequestDoneCallback callback ) { TaskPool.Instance.RequestUploadFile( url, postData, fileData, fileFieldName, fileName, new HttpRequestCallback( ( isOk, result, errResult ) => { callback( isOk, result, errResult ); } ) ); }
private static extern IntPtr SubmitClientRequest(string tag, string url, string[] headers, string method, string data, RequestDoneCallback doneDelegate, RequestProgressCallback progressDelegate = null);