'Encode `post_dict` (a dictionary) as UTF-8 encoded JSON.'

def _encode_post_dict(self, post_dict):

    return json.dumps({k: (v.encode('utf-8') if isinstance(v, basestring) else v) for (k, v) in post_dict.items()})
