title: How to use eucalyptus REST api in c#
body: <p>Could anyone help me with this example of REST api “describe eucalyptus instances” in c# without using AWS sdk for .net?
  I give you my sample code. This code is running in aws successfully, but in eucalyptus they give a “404 not found” error.</p>
  
  <pre><code>    protected void Page_Load(object sender, EventArgs e)
      {
          EucaListInstance("xyx/services/Eucalyptus"); 
      }
  
      private void ListEucaInstance(string inboundQueueUrl)
      {
  
          // Create a request for the URL.        
          string date = System.DateTime.UtcNow.ToString("s");
          string stringToSign = string.Format("DescribeInstances" + date);
          string signature = CalculateEucaSignature(stringToSign, true);
  
          StringBuilder sb = new StringBuilder();
          sb.Append(inboundQueueUrl);
          sb.Append("?Action=DescribeInstances");
          sb.Append("&amp;Version=2013-10-15");
          sb.AppendFormat("&amp;AWSAccessKeyId={0}", m_EucaAccessKeyID);
          sb.AppendFormat("&amp;Expires={0}", date);
          sb.AppendFormat("&amp;Signature={0}", signature);
  
          HttpWebRequest request = (HttpWebRequest)WebRequest.Create(sb.ToString());
          HttpWebResponse response = null;
          Stream dataStream = null;
          StreamReader reader = null;
  
          try
          {
              request.Credentials = CredentialCache.DefaultCredentials;
  
              response = (HttpWebResponse)request.GetResponse();
  
              // Get the stream containing content returned by the server.
              dataStream = response.GetResponseStream();
  
              // Open the stream using a StreamReader for easy access.
              reader = new StreamReader(dataStream);
  
          }
          catch (Exception ex)
          {
              Console.WriteLine(ex.Message);
          }
          finally
          {
              // Cleanup the streams and the response.
              if (reader != null)
                  reader.Close();
  
              if (dataStream != null)
                  dataStream.Close();
  
              if (response != null)
                  response.Close();
          }
  
      }
  
      private string CalculateEucaSignature(string data, bool urlEncode)
      {
          ASCIIEncoding ae = new ASCIIEncoding();
          HMACSHA1 signature = new HMACSHA1(ae.GetBytes(m_EucaSecretKey));
          string retSignature = Convert.ToBase64String(signature.ComputeHash(ae.GetBytes(data.ToCharArray())));
          return urlEncode ? HttpUtility.UrlEncode(retSignature) : retSignature;
      }
  </code></pre>