Beispiel #1
0
 /// <summary>
 /// Send and recieve string message.
 /// </summary>
 /// <param name="requestUri">The request uri to upload to.</param>
 /// <param name="message">The received message</param>
 /// <returns>The response message</returns>
 public string MessageString(string requestUri, string message)
 {
     try
     {
         Nequeo.Net.Http.HttpClient http = new Http.HttpClient();
         http.Connection = _connection;
         return(http.UploadString(requestUri, message));
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #2
0
 /// <summary>
 /// Send and recieve byte message.
 /// </summary>
 /// <param name="requestUri">The request uri to upload to.</param>
 /// <param name="message">The received message</param>
 /// <returns>The response message</returns>
 public byte[] MessageByte(string requestUri, byte[] message)
 {
     try
     {
         Nequeo.Net.Http.HttpClient http = new Http.HttpClient();
         http.Connection = _connection;
         return(Encoding.Default.GetBytes(http.UploadString(requestUri, Encoding.Default.GetString(message))));
     }
     catch (Exception)
     {
         throw;
     }
 }
 /// <summary>
 /// Uploads data to the request uri.
 /// </summary>
 /// <param name="requestUri">The request uri to upload to.</param>
 /// <param name="data">The data to upload.</param>
 /// <param name="method">The HTTP method used to send the file to the resource. If null, the default is POST for http.</param>
 /// <returns>A System.String containing the response sent by the server.</returns>
 public string UploadString(string requestUri, string data, string method)
 {
     Nequeo.Net.Http.HttpClient http = new Http.HttpClient();
     http.Connection = _connection;
     return(http.UploadString(requestUri, data, method));
 }