Example #1
0
 // Methods
 internal static byte[] ReadRequest(HttpRequest httpRequest)
 {
     byte[] emptyByteArray = null;
     if (httpRequest.RequestType == "POST")
     {
         using (httpRequest.InputStream)
         {
             return(BinaryConverter.ConvertStreamToByteArray(httpRequest.InputStream, (int)httpRequest.InputStream.Length));
         }
     }
     if (httpRequest.QueryString.Count > 0)
     {
         emptyByteArray = HttpUtility.UrlDecodeToBytes(httpRequest.QueryString[httpRequest.QueryString.Count - 1]);
     }
     if (emptyByteArray == null)
     {
         emptyByteArray = RpcHttpHelper.emptyByteArray;
     }
     if (log.IsDebugEnabled)
     {
         log.DebugFormat("GET Request: Length={0}", emptyByteArray.Length);
     }
     return(emptyByteArray);
 }