Esempio n. 1
0
    def _user_update_head(self, filename):
        headers, post_data = mulitpart_urlencode("pic", filename)
        args = []
        allowed_param = []

        return bind_api(
            path = '/user/update_head',
            method = 'POST',

            allowed_param = allowed_param
            )(self, *args, post_data=post_data, headers=headers)
Esempio n. 2
0
    def _user_update_head(self, filename):
        headers, post_data = mulitpart_urlencode("pic", filename)
        args = []
        allowed_param = []

        return bind_api(path='/user/update_head',
                        method='POST',
                        allowed_param=allowed_param)(self,
                                                     *args,
                                                     post_data=post_data,
                                                     headers=headers)
Esempio n. 3
0
    def _t_add_pic(self, filename, content="", longitude=0, latitude=0, clientip='127.0.0.1'):
        _, query = self.auth.authorize_request(
            "dummy", "POST", {}, dict(content=content, clientip=clientip, longitude=longitude, latitude=latitude))
        headers, post_data = mulitpart_urlencode("pic", filename, **dict(query))

        allowed_param = ['content', 'longitude', 'latitude', 'clientip']
        args = [content, longitude, latitude, clientip]
        return bind_api(
            path = '/t/add_pic',
            method = 'POST',
            payload_type = 'retid',
            allowed_param = allowed_param
            )(self, *args, post_data=post_data, headers=headers)
Esempio n. 4
0
    def _t_add_pic(self,
                   filename,
                   content="",
                   longitude=0,
                   latitude=0,
                   clientip='127.0.0.1'):
        _, query = self.auth.authorize_request(
            "dummy", "POST", {},
            dict(content=content,
                 clientip=clientip,
                 longitude=longitude,
                 latitude=latitude))
        headers, post_data = mulitpart_urlencode("pic", filename,
                                                 **dict(query))

        allowed_param = ['content', 'longitude', 'latitude', 'clientip']
        args = [content, longitude, latitude, clientip]
        return bind_api(path='/t/add_pic',
                        method='POST',
                        payload_type='retid',
                        allowed_param=allowed_param)(self,
                                                     *args,
                                                     post_data=post_data,
                                                     headers=headers)