def _openurl(inpt):
    data = None
    reference_file = None
    href = inpt.get('href')

    LOGGER.debug('Fetching URL %s', href)
    if inpt.get('method') == 'POST':
        if inpt.has_key('body'):
            data = inpt.get('body')
        elif inpt.has_key('bodyreference'):
            data = urlopen(url=inpt.get('bodyreference')).read()

        reference_file = urlopen(url=href, data=data)
    else:
        reference_file = urlopen(url=href)


    if PY2:
        reference_file_data = reference_file.read()
    else:
        reference_file_data = reference_file.read().decode('utf-8')

    return (reference_file, reference_file_data)
Return the resource corresponding to all the gists.
dataset/ETHPy150Open geopython/pywps/pywps/app/Service.py/_openurl--crossover with--dataset/ETHPy150Open ducksboard/libsaas/libsaas/services/github/service.py/GitHub.gists