third_party/blink/tools/blinkpy/w3c/wpt_github.py
def request(self, path, method, body=None, accept_header=None):
        """Sends a request to GitHub API and deserializes the response.

        Args:
            path: API endpoint without base URL (starting with '/').
            method: HTTP method to be used for this request.
            body: Optional payload in the request body (default=None).
            accept_header: Custom media type in the Accept header (default=None).

        Returns:
            A JSONResponse instance.
        """
        assert path.startswith('/')

        if body:
            if six.PY3:
                body = json.dumps(body).encode("utf-8")
            else:
                body = json.dumps(body)

        if accept_header:
            headers = {'Accept': accept_header}
        else:
            headers = {'Accept': 'application/vnd.github.v3+json'}

        if self.has_credentials():
            headers['Authorization'] = 'Basic {}'.format(self.auth_token())

        response = self.host.web.request(
            method=method, url=API_BASE + path, data=body, headers=headers)
        return JSONResponse(response)
Sends a request to GitHub API and deserializes the response.

        Args:
            path: API endpoint without base URL (starting with '/').
            method: HTTP method to be used for this request.
            body: Optional payload in the request body (default=None).
            accept_header: Custom media type in the Accept header (default=None).

        Returns:
            A JSONResponse instance.
        
Sends a request to GitHub API and deserializes the response.
Sends a request to GitHub API and deserializes the response .
def request(self, path, method, body=None, accept_header=None):
        assert path.startswith('/')
        if body:
            if six.PY3:
                body = json.dumps(body).encode("utf-8")
            else:
                body = json.dumps(body)
        if accept_header:
            headers = {'Accept': accept_header}
        else:
            headers = {'Accept': 'application/vnd.github.v3+json'}
        if self.has_credentials():
            headers['Authorization'] = 'Basic {}'.format(self.auth_token())
        response = self.host.web.request(
            method=method, url=API_BASE + path, data=body, headers=headers)
        return JSONResponse(response)
def request ( self , path , method , body = None , accept_header = None ) : assert path . startswith ( '/' ) if body : if six . PY3 : body = json . dumps ( body ) . encode ( "utf-8" ) else : body = json . dumps ( body ) if accept_header : headers = { 'Accept' : accept_header } else : headers = { 'Accept' : 'application/vnd.github.v3+json' } if self . has_credentials ( ) : headers [ 'Authorization' ] = 'Basic {}' . format ( self . auth_token ( ) ) response = self . host . web . request ( method = method , url = API_BASE + path , data = body , headers = headers ) return JSONResponse ( response )
Sends a request to GitHub API and deserializes the response.
Sends a request to GitHub API and deserializes the response .
"""Sends a request to GitHub API and deserializes the response.

        Args:
            path: API endpoint without base URL (starting with '/').
            method: HTTP method to be used for this request.
            body: Optional payload in the request body (default=None).
            accept_header: Custom media type in the Accept header (default=None).

        Returns:
            A JSONResponse instance.
        """
A JSONResponse instance.
A JSONResponse instance .
self
path
API endpoint without base URL (starting with '/').
API endpoint without base URL ( starting with ' / ' ) .
method
HTTP method to be used for this request.
HTTP method to be used for this request .
body
Optional payload in the request body (default=None).
Optional payload in the request body ( default = None ) .
accept_header
Custom media type in the Accept header (default=None).
Custom media type in the Accept header ( default = None ) .