How to use the quarry.utils.http.request function in quarry

To help you get started, we’ve selected a few quarry examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github barneygale / quarry / quarry / mojang / profile.py View on Github external
def _req(self, endpoint, **data):
        return http.request(
            url=b"https://authserver.mojang.com/"+endpoint,
            timeout=self.timeout,
            err_type=ProfileException,
            data=data)
github barneygale / quarry / quarry / mojang / auth.py View on Github external
def join(timeout, digest, access_token, uuid):
    return http.request(
        url=b"https://sessionserver.mojang.com/session/minecraft/join",
        timeout=timeout,
        err_type=AuthException,
        data={
            "accessToken": access_token,
            "selectedProfile": uuid.to_hex(with_dashes=False),
            "serverId": digest})
github barneygale / quarry / quarry / mojang / auth.py View on Github external
def has_joined(timeout, digest, username):
    return http.request(
        url=b"https://sessionserver.mojang.com/session/minecraft/hasJoined"
            b"?username=" + username.encode('ascii') + \
            b"&serverId=" + digest.encode('ascii'),
        timeout=timeout,
        err_type=AuthException,
        expect_content=True)