http_client.py
def request(self, keyword, params_from_interface=None, data=None, url_complement=None):
        
        """
        Builds an HTTP request from raw data. 
        
        The keyword corresponds to the desired action, as mentionned above. 
        ex: 'start_rapid_execution' in order to start the execution of a 
        program on the robot.
        
        Some URL parameters are undirectly given by the user, from the interface, 
        under the form of a dictionary : params_from_interface. 
        
        Data can also be sent if necessary. Like parameters, data are given thanks 
        to the 'data' dictionary in argument.
        
        :param keyword: str : Keyword corresponding to a particular action
        :param params_from_interface: dict : URL parameters 
        :param data: dict : Data which will be sent
        
        :return: Response : The request's response. 
        """
        
        # dictionary corresponding to the called service
        # its gives data enabling to build the request
        service_dictionary = HTTPClient.REQUESTS_DICTIONARY.get(keyword)
        
        if HTTPClient.DEBUG:
            print("service_dictionary : {}".format(service_dictionary))
        
        # service_dictionary.get('url') : location of the resource 
        # in the RWS tree-like structure
        url = self.rws_server_url + service_dictionary.get('url')
        if url_complement is not None:
            url += url_complement
        
        if HTTPClient.DEBUG:
            print("url : {}".format(url))
        
        # parameters by default are completed or replaced by the parameters in argument
        params = service_dictionary.get('default_params')
        HTTPClient.dict_fusion(params, params_from_interface)
        
        if HTTPClient.DEBUG:
            print("params : {}".format(params))
            print("data : {}".format(data))
        
        # request building and returning the response
        return self.session.request(service_dictionary.get('method'), url, params=params, data=data)

        Builds an HTTP request from raw data. 
        
        The keyword corresponds to the desired action, as mentionned above. 
        ex: 'start_rapid_execution' in order to start the execution of a 
        program on the robot.
        
        Some URL parameters are undirectly given by the user, from the interface, 
        under the form of a dictionary : params_from_interface. 
        
        Data can also be sent if necessary. Like parameters, data are given thanks 
        to the 'data' dictionary in argument.
        
        :param keyword: str : Keyword corresponding to a particular action
        :param params_from_interface: dict : URL parameters 
        :param data: dict : Data which will be sent
        
        :return: Response : The request's response. 
        
Builds an HTTP request from raw data.
The keyword corresponds to the desired action, as mentionned above.
ex: 'start_rapid_execution' in order to start the execution of a
program on the robot.

Some URL parameters are undirectly given by the user, from the interface,
under the form of a dictionary : params_from_interface.

Data can also be sent if necessary. Like parameters, data are given thanks
to the 'data' dictionary in argument.
Builds an HTTP request from raw data . The keyword corresponds to the desired action as mentionned above . ex : ' start_rapid_execution ' in order to start the execution of a program on the robot . Some URL parameters are undirectly given by the user from the interface under the form of a dictionary : params_from_interface . Data can also be sent if necessary . Like parameters data are given thanks to the ' data ' dictionary in argument .
def request(self, keyword, params_from_interface=None, data=None, url_complement=None):
        service_dictionary = HTTPClient.REQUESTS_DICTIONARY.get(keyword)
        if HTTPClient.DEBUG:
            print("service_dictionary : {}".format(service_dictionary))
        url = self.rws_server_url + service_dictionary.get('url')
        if url_complement is not None:
            url += url_complement
        if HTTPClient.DEBUG:
            print("url : {}".format(url))
        params = service_dictionary.get('default_params')
        HTTPClient.dict_fusion(params, params_from_interface)
        if HTTPClient.DEBUG:
            print("params : {}".format(params))
            print("data : {}".format(data))
        return self.session.request(service_dictionary.get('method'), url, params=params, data=data)
def request ( self , keyword , params_from_interface = None , data = None , url_complement = None ) : service_dictionary = HTTPClient . REQUESTS_DICTIONARY . get ( keyword ) if HTTPClient . DEBUG : print ( "service_dictionary : {}" . format ( service_dictionary ) ) url = self . rws_server_url + service_dictionary . get ( 'url' ) if url_complement is not None : url += url_complement if HTTPClient . DEBUG : print ( "url : {}" . format ( url ) ) params = service_dictionary . get ( 'default_params' ) HTTPClient . dict_fusion ( params , params_from_interface ) if HTTPClient . DEBUG : print ( "params : {}" . format ( params ) ) print ( "data : {}" . format ( data ) ) return self . session . request ( service_dictionary . get ( 'method' ) , url , params = params , data = data )
Builds an HTTP request from raw data.
Builds an HTTP request from raw data .
"""
        Builds an HTTP request from raw data. 
        
        The keyword corresponds to the desired action, as mentionned above. 
        ex: 'start_rapid_execution' in order to start the execution of a 
        program on the robot.
        
        Some URL parameters are undirectly given by the user, from the interface, 
        under the form of a dictionary : params_from_interface. 
        
        Data can also be sent if necessary. Like parameters, data are given thanks 
        to the 'data' dictionary in argument.
        
        :param keyword: str : Keyword corresponding to a particular action
        :param params_from_interface: dict : URL parameters 
        :param data: dict : Data which will be sent
        
        :return: Response : The request's response. 
        """ # dictionary corresponding to the called service # its gives data enabling to build the request # service_dictionary.get('url') : location of the resource  # in the RWS tree-like structure # parameters by default are completed or replaced by the parameters in argument # request building and returning the response
Response : The request's response.
Response : The request ' s response .
self
keyword
str : Keyword corresponding to a particular action
str : Keyword corresponding to a particular action
params_from_interface
dict : URL parameters
dict : URL parameters
data
dict : Data which will be sent
dict : Data which will be sent
url_complement