def make_request(url, data, on_complete):
    """
    Make AJAX request to `url` with given POST `data`. Call `on_complete`
    callback when complete.

    Args:
        url (str): URL.
        data (dict): Dictionary with POST data.
        on_complete (ref): Reference to function / method which will be called
            when the request is done.
    """
    req = ajax.ajax()
    req.bind('complete', on_complete)
    req.open('POST', url, True)
    req.set_header('content-type', 'application/x-www-form-urlencoded')
    req.send(data)
def make_request ( url , data , on_complete ) : req = ajax . ajax ( ) req . bind ( 'complete' , on_complete ) req . open ( 'POST' , url , True ) req . set_header ( 'content-type' , 'application/x-www-form-urlencoded' ) req . send ( data )
Make AJAX request to `url` with given POST `data`. Call `on_complete`
    callback when complete.

    Args:
        url (str): URL.
        data (dict): Dictionary with POST data.
        on_complete (ref): Reference to function / method which will be called
            when the request is done.