@staticmethod
def _dict_to_headers(d):
    """Convert a dictionary into one suitable for a HTTP request.

        d: a dictionary

        Returns: the same dictionary, with x-image-meta added to every key
        """
    h = {}
    for key in d:
        if key == 'properties':
            for subkey in d[key]:
                if d[key][subkey] is None:
                    h['x-image-meta-property-%s' % subkey] = ''
                else:
                    h['x-image-meta-property-%s' % subkey] = d[key][subkey]
        else:
            h['x-image-meta-%s' % key] = d[key]
    return h
