title: Ways to send byte arrays over https without base64 encoding?
body: <p>My outlook plugin sends large files over https. Currently I'm using Convert.ToBase64String() on the client side and Convert.FromBase64String() on the http handler on the IIS Side.</p>
  
  <p>This has come to some performance issues, and also i'm also securing the data over SSL so i'm really asking if there's any way to convert a byte array over https without using encoding that will cost cpu performance on the recipient end.</p>
  
  <p>My Client code:</p>
  
  <pre><code>string requestURL = "http://192.168.1.46/websvc/transfer.trn";
  HttpWebRequest request = (HttpWebRequest)WebRequest.Create(requestURL);
  request.Method = "POST";
  request.ContentType = "application/x-www-form-urlencoded";
  
  // Chunk(buffer) is converted to Base64 string that will be convert to Bytes on  the handler.
  string requestParameters = @"fileName=" + fileName + @"&amp;secretKey=testKey=" + @"&amp;currentChunk=" + i + @"&amp;totalChunks=" + totalChunks + @"&amp;smGuid=" + smGuid +
                              "&amp;data=" + HttpUtility.UrlEncode(Convert.ToBase64String(bytes));
  
  // finally whole request will be converted to bytes that will be transferred to HttpHandler
  byte[] byteData = Encoding.UTF8.GetBytes(requestParameters);
  
  request.ContentLength = byteData.Length;
  
  Stream writer = request.GetRequestStream();
  writer.Write(byteData, 0, byteData.Length);
  writer.Close();
  // here we will receive the response from HttpHandler
  StreamReader stIn = new StreamReader(request.GetResponse().GetResponseStream());
  string strResponse = stIn.ReadToEnd();
  stIn.Close();
  </code></pre>
  
  <p>Server code where I have performance issues:</p>
  
  <pre><code>byte[] buffer = Convert.FromBase64String(context.Request.Form["data"]); // 
  </code></pre>