third_party/blink/tools/blinkpy/w3c/gerrit.py
def post(self, path, data):
        """Sends a POST request to path with data as the JSON payload.

        The path has to be prefixed with '/a/':
        https://gerrit-review.googlesource.com/Documentation/rest-api.html#authentication
        """
        assert path.startswith('/a/'), \
            'POST requests need to use authenticated routes.'
        url = URL_BASE + path
        assert self.user and self.token, 'Gerrit user and token required for authenticated routes.'

        b64auth = base64.b64encode('{}:{}'.format(self.user,
                                                  self.token).encode('utf-8'))
        headers = {
            'Authorization': 'Basic {}'.format(b64auth.decode('utf-8')),
            'Content-Type': 'application/json',
        }
        return self.host.web.request('POST',
                                     url,
                                     data=json.dumps(data).encode('utf-8'),
                                     headers=headers)
Sends a POST request to path with data as the JSON payload.

        The path has to be prefixed with '/a/':
        https://gerrit-review.googlesource.com/Documentation/rest-api.html#authentication
        
Sends a POST request to path with data as the JSON payload.
Sends a POST request to path with data as the JSON payload .
def post(self, path, data):
        assert path.startswith('/a/'), \
            'POST requests need to use authenticated routes.'
        url = URL_BASE + path
        assert self.user and self.token, 'Gerrit user and token required for authenticated routes.'
        b64auth = base64.b64encode('{}:{}'.format(self.user,
                                                  self.token).encode('utf-8'))
        headers = {
            'Authorization': 'Basic {}'.format(b64auth.decode('utf-8')),
            'Content-Type': 'application/json',
        }
        return self.host.web.request('POST',
                                     url,
                                     data=json.dumps(data).encode('utf-8'),
                                     headers=headers)
def post ( self , path , data ) : assert path . startswith ( '/a/' ) , 'POST requests need to use authenticated routes.' url = URL_BASE + path assert self . user and self . token , 'Gerrit user and token required for authenticated routes.' b64auth = base64 . b64encode ( '{}:{}' . format ( self . user , self . token ) . encode ( 'utf-8' ) ) headers = { 'Authorization' : 'Basic {}' . format ( b64auth . decode ( 'utf-8' ) ) , 'Content-Type' : 'application/json' , } return self . host . web . request ( 'POST' , url , data = json . dumps ( data ) . encode ( 'utf-8' ) , headers = headers )
Sends a POST request to path with data as the JSON payload.
Sends a POST request to path with data as the JSON payload .
"""Sends a POST request to path with data as the JSON payload.

        The path has to be prefixed with '/a/':
        https://gerrit-review.googlesource.com/Documentation/rest-api.html#authentication
        """
self
path
data