Get the response for the given enclosure URL
357989
def get(self, url):
        
        self._query()
        return Enclosure(self._resp.get(url), url)
752514
def _http_response(self, url, method, data=None, **kwargs):
        
        header = {'content-type': 'application/json'}

        if data:
            data = json.dumps(data)
        path = url.format(**kwargs)
        logger.debug("%s %s", method.__name__.upper(), path)
        response = method(self.host + path,
                          data=data, headers=header, **self.method_kwargs)
        logger.debug("%s %s", response.status_code, response.reason)
        response.raise_for_status()

        return response
1012855
def build_response(content, code=200):
    """"""
    response = make_response( jsonify(content), content['code'] )
    response.headers['Access-Control-Allow-Origin'] = '*'
    response.headers['Access-Control-Allow-Headers'] = \
            'Origin, X-Requested-With, Content-Type, Accept, Authorization'
    return response
1176090
def response(self, url):
        """"""
        
        resp = requests.get(url).content
        return self.parseresponse(resp)
202085
def getReservation
      response = conncetion.post do |req|
        req.url "res", options
      end
      return_error_or_body(response, response.body)
   end
1224341
async def _get_response(self, msg):
        """"""
        try:
            protocol = await self._get_protocol()
            pr = protocol.request(msg)
            r = await pr.response
            return pr, r
        except ConstructionRenderableError as e:
            raise ClientError("There was an error with the request.", e)
        except RequestTimedOut as e:
            await self._reset_protocol(e)
            raise RequestTimeout('Request timed out.', e)
        except (OSError, socket.gaierror, Error) as e:
            # aiocoap sometimes raises an OSError/socket.gaierror too.
            # aiocoap issue #124
            await self._reset_protocol(e)
            raise ServerError("There was an error with the request.", e)
        except asyncio.CancelledError as e:
            await self._reset_protocol(e)
            raise e
76270
public ClientResponse getResponse(String url, Method method)
      throws Exception {
    Builder resource = getResource(url);
    ClientResponse response = null;
    switch (method) {
    case Get:
      response = resource.get(ClientResponse.class);
      break;
    case Post:
      response = resource.post(ClientResponse.class);
      break;
    case Head:
      response = resource.head();
      break;
    case Put:
      response = resource.put(ClientResponse.class);
      break;
    }
    return response;
  }
452817
def get_response(self):
        
        res = ARBlockRes()
        for field in ["ARType", "ARUUID", "SessionKey"]:
            res.setfieldval(field, self.getfieldval(field))
        return res
1043944
private static String fetchHttpResponse(URL url) throws IOException {
      HttpURLConnection conn = null;
      try {
         logger.info("fetching from url = " + url);
         conn = (HttpURLConnection) url.openConnection();
         int response = conn.getResponseCode();
         if (response != HttpURLConnection.HTTP_ACCEPTED) {
            String responseContent = IOUtils.toString(conn.getInputStream());
            logger.info("responseContent = " + responseContent);
            
            return responseContent;
         }
         throw new IOException("response from service not valid");
      } catch (IOException e) {
         logger.severe("unable to do proper http request url = " + url.toString());
         throw e;
      } finally {
         conn.disconnect();
      }

   }
1152409
def fetch(self, url):
        '''
        
        '''
        opener = self._urllib.build_opener()
        opener.addheaders = self._requestHeaders.items()
        response = opener.open(url)
        headers = response.info()
        raw = response.read()
        raw = raw.decode('utf8')

        if not 'Content-Type' in headers:
            raise OEmbedError('Missing mime-type in response')

        if headers['Content-Type'].find('application/xml') != -1 or \
           headers['Content-Type'].find('text/xml') != -1:
            response = OEmbedResponse.newFromXML(raw)
        elif headers['Content-Type'].find('application/json') != -1 or \
             headers['Content-Type'].find('text/javascript') != -1 or \
             headers['Content-Type'].find('text/json') != -1:
            response = OEmbedResponse.newFromJSON(raw)
        else:
            raise OEmbedError('Invalid mime-type in response - %s' % headers['Content-Type'])

        return response
340715
def get(self, url):
        
        r = requests.get(self._format_url(url), headers=self.headers, timeout=TIMEOUT)
        self._check_response(r, 200)

        return r.json()
562700
def get_response(self, url, username=None, password=None):
        
        scheme, netloc, path, query, frag = urlparse.urlsplit(url)
        req = self.get_request(url)

        stored_username, stored_password = self.passman.find_user_password(None, netloc)
        # see if we have a password stored
        if stored_username is None:
            if username is None and self.prompting:
                username = urllib.quote(raw_input('User for %s: ' % netloc))
                password = urllib.quote(getpass.getpass('Password: '))
            if username and password:
                self.passman.add_password(None, netloc, username, password)
            stored_username, stored_password = self.passman.find_user_password(None, netloc)
        authhandler = urllib2.HTTPBasicAuthHandler(self.passman)
        opener = urllib2.build_opener(authhandler)
        # FIXME: should catch a 401 and offer to let the user reenter credentials
        return opener.open(req)
1125870
def _get(self, uri, params=None, headers=None):
        
        if not headers:
            headers = self._get_headers()

        logging.debug("URI=" + str(uri))
        logging.debug("HEADERS=" + str(headers))

        response = self.session.get(uri, headers=headers, params=params)
        logging.debug("STATUS=" + str(response.status_code))
        if response.status_code == 200:
            return response.json()
        else:
            logging.error(b"ERROR=" + response.content)
            response.raise_for_status()
923533
def get_fetch_response(self, raw):
        """"""
        p = Payload(raw)
        p._body = p.body
        return p
1184658
def get_response(url, referer = nil)
      full_path = url.query.nil? ? url.path : "#{url.path}?#{url.query}"

      opts = {}
      opts['User-Agent'] = user_agent if user_agent
      opts['Referer'] = referer.to_s if referer
      opts['Cookie'] = @cookie_store.to_s unless @cookie_store.empty? || (!accept_cookies? && @opts[:cookies].nil?)

      retries = 0
      begin
        start = Time.now()
        # format request
        req = Net::HTTP::Get.new(full_path, opts)
        # HTTP Basic authentication
        req.basic_auth url.user, url.password if url.user
        response = connection(url).request(req)
        finish = Time.now()
        response_time = ((finish - start) * 1000).round
        @cookie_store.merge!(response['Set-Cookie']) if accept_cookies?
        return response, response_time
      rescue Timeout::Error, Net::HTTPBadResponse, EOFError => e
        puts e.inspect if verbose?
        refresh_connection(url)
        retries += 1
        retry unless retries > 3
      end
    end
768188
def getFlaskResponse(responseString, httpStatus=200):
    
    return flask.Response(responseString, status=httpStatus, mimetype=MIMETYPE)
929551
def _get(self, url, params=None, headers=None):
        """"""
        url = self.clean_url(url)
        response = requests.get(url, params=params, verify=self.verify,
                                timeout=self.timeout, headers=headers)
        return response