Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Downloads a request uri to a local file.
 /// </summary>
 /// <param name="requestUri">The request uri to download.</param>
 /// <param name="destinationFile">The local destination file to copy the data to.</param>
 public void DownloadFile(string requestUri, string destinationFile)
 {
     Nequeo.Net.Http.HttpClient http = new Http.HttpClient();
     http.Connection = _connection;
     http.DownloadFile(requestUri, destinationFile);
 }
Exemplo n.º 4
0
 /// <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));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Upload a local file to the request uri.
 /// </summary>
 /// <param name="requestUri">The request uri to upload to.</param>
 /// <param name="sourceFile">The local source file to upload data from.</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.Byte array containing the body of the response from the resource.</returns>
 public byte[] UploadFile(string requestUri, string sourceFile, string method)
 {
     Nequeo.Net.Http.HttpClient http = new Http.HttpClient();
     http.Connection = _connection;
     return(http.UploadFile(requestUri, sourceFile, method));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Downloads data from the request uri.
 /// </summary>
 /// <param name="requestUri">The request uri to download.</param>
 /// <returns>The returned request uri content.</returns>
 public string DownloadString(string requestUri)
 {
     Nequeo.Net.Http.HttpClient http = new Http.HttpClient();
     http.Connection = _connection;
     return(http.DownloadString(requestUri));
 }