Esempio n. 1
0
 /// <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 );
         } )
         );
 }
Esempio n. 2
0
 /// <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 );
         } )
         );
 }
Esempio n. 3
0
 /// <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 );
         } ) );
 }
Esempio n. 4
0
 private static extern IntPtr SubmitClientRequest(string tag, string url, string[] headers, string method, string data, RequestDoneCallback doneDelegate, RequestProgressCallback progressDelegate = null);