We are in the process of migrating this forum. A new space will be available soon. We are sorry for the inconvenience.

OPENSTACK - Get Object Metadata


dawka902
09-24-2014, 01:53 PM
Ok,

I'm resolve problem, i not close response stream.
Code:
            string url = //url to object
            string token =""; //token
            try
            {
                var request = WebRequest.Create(url);
                request.Headers.Add("X-Auth-Token", token);
                request.Method = "HEAD";

                var response = request.GetResponse();
                if (response != null)
                {
                    // You can now use response.Headers to get header info
                }
                response.Close();

                return;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }

vcasse
09-24-2014, 09:40 AM
Hi,

Can you send my, by PM, the url you try to contact ?

Regards,
Vincent

dawka902
09-24-2014, 03:20 AM
hi,
when send i request to hubic to get metadata of not exists object, i get timeout and my token expires(every next request return timeout).

in api documetation i read http://docs.openstack.org/api/openst...-metadata.html
that i would be HTTP 404 code

my c# code:
Code:
            string url = //url to object
            string token =""; //token
            try
            {
                var request = WebRequest.Create(url);
                request.Headers.Add("X-Auth-Token", token);
                request.Method = "HEAD";

                var response = request.GetResponse();
                if (response != null)
                {
                    // You can now use response.Headers to get header info
                }


                return;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }