HTTP Session property

        :return: vk_requests.utils.VerboseHTTPSession instance
963805
def http_session(self):
        
        if self._http_session is None:
            session = VerboseHTTPSession()
            session.headers.update(self.DEFAULT_HTTP_HEADERS)
            self._http_session = session
        return self._http_session
639517
def _get_requests_session():
    """"""
    global requests_session
    if requests_session is not None:
        return requests_session
    import requests

    requests_session = requests.Session()
    adapter = requests.adapters.HTTPAdapter(
        max_retries=environments.PIPENV_MAX_RETRIES
    )
    requests_session.mount("https://pypi.org/pypi", adapter)
    return requests_session
626863
public HttpSession newHttpSession(HttpServletRequest request)
    {
        Session session = newSession(request);
        session.setMaxInactiveInterval(_dftMaxIdleSecs);
        synchronized(__allSessions)
        {
            synchronized(this)
            {
              _sessions.put(session.getId(),session);
              __allSessions.add(session.getId(), session);
              if (_sessions.size() > this._maxSessions)
                  this._maxSessions = _sessions.size ();
            }
        }
        
        HttpSessionEvent event=new HttpSessionEvent(session);
        
        for(int i=0;i<_sessionListeners.size();i++)
            ((HttpSessionListener)_sessionListeners.get(i))
            .sessionCreated(event);
        
        if (getCrossContextSessionIDs())
            request.setAttribute(__NEW_SESSION_ID, session.getId());
        return session;
    }
739289
def _get_at_from_session(self):
        
        try:
            return self.request.session['oauth_%s_access_token'
                                        % get_token_prefix(
                                            self.request_token_url)]
        except KeyError:
            raise OAuthError(
                _('No access token saved for "%s".')
                % get_token_prefix(self.request_token_url))
479381
def requests_session(self, *args, **kwargs):
        
        import requests
        auth1 = self.generate_auth()
        return requests.Session(*args, auth=auth1, **kwargs)
896800
def get_current_session(request, hproPk):
    """"""

    retour = {}

    base_key = 'plugit_' + str(hproPk) + '_'

    for key, value in request.session.iteritems():
        if key.startswith(base_key):
            retour[key[len(base_key):]] = value

    return retour
821773
def get_session():
    
    config = PyquilConfig()
    session = requests.Session()
    retry_adapter = HTTPAdapter(max_retries=Retry(total=3,
                                                  method_whitelist=['POST'],
                                                  status_forcelist=[502, 503, 504, 521, 523],
                                                  backoff_factor=0.2,
                                                  raise_on_status=False))

    session.mount("http://", retry_adapter)
    session.mount("https://", retry_adapter)

    # We need this to get binary payload for the wavefunction call.
    session.headers.update({"Accept": "application/octet-stream",
                            "X-User-Id": config.user_id,
                            "X-Api-Key": config.api_key})

    session.headers.update({
        'Content-Type': 'application/json; charset=utf-8'
    })

    return session
341726
HttpSession newSession()
    {
        HttpSession session=_servletHandler.newHttpSession(this);
        Cookie cookie=_servletHandler.getSessionManager().getSessionCookie(session,isSecure());
        if (cookie!=null)
            _servletHttpResponse.getHttpResponse().addSetCookie(cookie);
        return session;
    }
1072881
function getSession(apiKey) {
  var session = Sessions.get(apiKey)

  if (session) return session

  session = new Session()
  Sessions.set(apiKey, session)

  return session
}
240819
def session_request(session, url, **kwargs):
    """"""
    try:
        response = session(url, **kwargs)

        response.raise_for_status()

        return response.text

    except requests.exceptions.HTTPError as errh:
        _LOGGER.debug("%s, %s", response, errh)
        raise_error(response.status_code)

    except requests.exceptions.ConnectionError as errc:
        _LOGGER.debug("%s", errc)
        raise RequestError("Connection error: {}".format(errc))

    except requests.exceptions.Timeout as errt:
        _LOGGER.debug("%s", errt)
        raise RequestError("Timeout: {}".format(errt))

    except requests.exceptions.RequestException as err:
        _LOGGER.debug("%s", err)
        raise RequestError("Unknown error: {}".format(err))
1359818
def getSessionFromFile(self, file, verbose=None):
        

        response=api(url=self.___url+'session', PARAMS={'file':file}, method="GET", verbose=verbose, parse_params=False)
        return response
304633
def wrap_session_request(wrapped, instance, args, kwargs):
    """"""
    method = kwargs.get('method') or args[0]
    url = kwargs.get('url') or args[1]

    blacklist_hostnames = execution_context.get_opencensus_attr(
        'blacklist_hostnames')
    parsed_url = urlparse(url)
    if parsed_url.port is None:
        dest_url = parsed_url.hostname
    else:
        dest_url = '{}:{}'.format(parsed_url.hostname, parsed_url.port)
    if utils.disable_tracing_hostname(dest_url, blacklist_hostnames):
        return wrapped(*args, **kwargs)

    _tracer = execution_context.get_opencensus_tracer()
    _span = _tracer.start_span()

    _span.name = '[requests]{}'.format(method)
    _span.span_kind = span_module.SpanKind.CLIENT

    try:
        tracer_headers = _tracer.propagator.to_headers(
            _tracer.span_context)
        kwargs.setdefault('headers', {}).update(
            tracer_headers)
    except Exception:  # pragma: NO COVER
        pass

    # Add the requests url to attributes
    _tracer.add_attribute_to_current_span(HTTP_URL, url)

    result = wrapped(*args, **kwargs)

    # Add the status code to attributes
    _tracer.add_attribute_to_current_span(
        HTTP_STATUS_CODE, str(result.status_code))

    _tracer.end_span()
    return result
513311
def _put_request(self, url, headers, data=None):
        
        return self._session.put(url, headers=headers, data=data)
981352
def request(self, method, url, **kwargs):
        """"""
        if not url.startswith('https'):
            url = '{}{}'.format(self.args.tc_api_path, url)
        return super(TcExSession, self).request(method, url, **kwargs)
637165
def get_session_url(session_id, type='view', **params):
        
        url = 'sessions/{}/{}'.format(session_id, type)
        url = urljoin(API_URL, url)
        return add_to_url(url, **params)
116914
def http_session(cookies=None):
    
    session = requests.Session()
    if cookies is not False:
        session.cookies.update(cookies or cookiejar())
    session.headers.update({'User-Agent': 'ipsv/{v}'.format(v=ips_vagrant.__version__)})

    return session
810255
def _get(self, *args, **kwargs):
        

        if 'timeout' not in kwargs:
            kwargs['timeout'] = self.timeout

        req = self.session.get(*args, **kwargs)
        return req