import sys

from twisted.internet.task import react

from twisted.web.client import Agent, ResponseFailed

@react
def main(reactor):
    agent = Agent(reactor)
    requested = agent.request(b"GET", sys.argv[1].encode("ascii"))
    def gotResponse(response):
        print(response.code)
    def noResponse(failure):
        failure.trap(ResponseFailed)
        print(failure.value.reasons[0].getTraceback())
    return requested.addCallbacks(gotResponse, noResponse)
2e847889e49696e1b845884f6cf7d8e55102304e
<mask token>

<mask token>


@react
def main(reactor):
    agent = Agent(reactor)
    requested = agent.request(b'GET', sys.argv[1].encode('ascii'))

    def gotResponse(response):
        print(response.code)

    def noResponse(failure):
        failure.trap(ResponseFailed)
        print(failure.value.reasons[0].getTraceback())
    return requested.addCallbacks(gotResponse, noResponse)

import sys
from twisted.internet.task import react
from twisted.web.client import Agent, ResponseFailed


@react
def main(reactor):
    agent = Agent(reactor)
    requested = agent.request(b'GET', sys.argv[1].encode('ascii'))

    def gotResponse(response):
        print(response.code)

    def noResponse(failure):
        failure.trap(ResponseFailed)
        print(failure.value.reasons[0].getTraceback())
    return requested.addCallbacks(gotResponse, noResponse)

import sys

from twisted.internet.task import react

from twisted.web.client import Agent, ResponseFailed

@react
def main(reactor):
    agent = Agent(reactor)
    requested = agent.request(b"GET", sys.argv[1].encode("ascii"))
    def gotResponse(response):
        print(response.code)
    def noResponse(failure):
        failure.trap(ResponseFailed)
        print(failure.value.reasons[0].getTraceback())
    return requested.addCallbacks(gotResponse, noResponse)