Init Session
The GET operation will init user session.
@return ApiResponse&lt;ApiSuccessResponse&gt;
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
161258
public ApiResponse<ApiSuccessResponse> initProvisioningWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = initProvisioningValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiSuccessResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
475369
public function startHTTPSession()
    {
        // @codeCoverageIgnoreStart
        // Safety measure - can't test this without replacing PHP
        if (session_status() === PHP_SESSION_DISABLED)
            throw new \RuntimeException("Sesssions are disabled");
        // @codeCoverageIgnoreEnd

        if (session_status() === PHP_SESSION_ACTIVE)
            throw new \LogicException("Repeated session initialization");

        // Now do the PHP session magic to initialize the $_SESSION array
        session_set_cookie_params(
            $this->lifetime, 
            $this->session_cookie->getPath(),
            $this->session_cookie->getDomain(),
            $this->session_cookie->getSecure(),
            $this->session_cookie->getHTTPOnly()
        );
        session_name($this->session_cookie->getName());

        $custom_session_id = defined('WEDETO_TEST') && WEDETO_TEST === 1 && $this->session_id !== null;
        if ($custom_session_id)
        {
            ini_set('session.use_strict_mode', 0);
            session_id($this->session_id);
        }
            
        session_start();

        if ($custom_session_id)
            ini_set('session.use_strict_mode', 1);

        // Store the session ID
        $this->session_id = session_id();

        // Make sure the session data is accessible through this object
        $this->values = &$_SESSION;

        // Check if session was regenerated
        $this->secureSession();

        // PHPs sessions do not renew the cookie, so it will expire after the
        // period set when the session was first created. We want to postpone
        // the session expiry at every request, so force a cookie to be sent.
        // As the session_id is available after the session started, we need to
        // update the cookie that was generated in the constructor.
        $this->session_cookie->setValue(session_id());

        // Session has been started
        $this->active = true;

        return $this;
    }
63347
private static function initialize()
    {
        if (self::$initialized) return;

        self::$client = \OpenId::getClient();
        self::$version = config('openid.api-version');
        self::$initialized = TRUE;
    }
959712
async def api_get(self, url, params=None):
        """"""
        request = None
        headers = DEFAULT_HEADERS.copy()
        headers.update({'Session-Token': self._token})

        try:
            with async_timeout.timeout(DEFAULT_TIMEOUT, loop=self._event_loop):
                request = await self._api_session.get(
                    url, headers=headers, params=params)
            # _LOGGER.debug('Get URL: %s', request.url)
            if request.status != 200:
                _LOGGER.error('Error fetching Eight data: %s', request.status)
                return None

            if 'application/json' in request.headers['content-type']:
                request_json = await request.json()
            else:
                _LOGGER.debug('Response was not JSON, returning text.')
                request_json = await request.text()

            return request_json

        except (aiohttp.ClientError, asyncio.TimeoutError,
                ConnectionRefusedError) as err:
            _LOGGER.error('Error fetching Eight data. %s', err)
            return None
321776
public static function init()
    {
        $c = new Configuration();
        $cc = $c->from('app')->get('session');

        if (strtolower($cc) == 'session') {
            return new Session();
        } elseif (strtolower($cc) == 'file') {
            return new File();
        } elseif (strtolower($cc) == 'cookie') {
            return new Cookie();
        } else {
            throw new \Exception($cc.' is not a supported session type!');
        }
    }
805099
private function initResponse(): App
    {
        try {
            $response = new Response();
            $this->containers()->set('response', $response);
        } catch (\InvalidArgumentException $e) {
            new Exception($e);
        }
        return $this;
    }
343081
private function initializeRequest()
	{
		$this->isComplete = false;
		$this->responseBody = "";
		$this->responseHeaders = array();
		$this->options[CURLOPT_HTTPHEADER] = $this->headers;

		$ch = curl_init();
		curl_setopt_array($ch, $this->options);
		return $ch;
	}
1277385
public function getSession()
    {
        if (null === $this->requestStack) {
            throw new \RuntimeException('The "app.session" variable is not available.');
        }

        if ($request = $this->getRequest()) {
            return $request->getSession();
        }
    }
726740
@Produces(MediaType.TEXT_PLAIN)
        @GET
        public Response apiInfo(@Context Session session){


            return Response.ok().entity(VERSION).build();
        }
904752
public ApiResponse<GetLogout> getLogoutWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = getLogoutValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<GetLogout>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
1215535
public ApiResponse<GetConfigResponse> getConfigWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = getConfigValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<GetConfigResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
1244235
def authenticate(self):
        
        resp = self.session.get(self.api_url, auth=self.auth)
        resp = self._process_response(resp)
        return resp
312099
public ApiResponse<UserEnvelope> getSelfWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = getSelfValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<UserEnvelope>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
1110332
protected function initialize() {
	$request   = bootstrap::get_library('request');
	$response  = bootstrap::get_library('response');
	$exception = bootstrap::get_library('exception');
	
	$this->url    = $request::get_url();
	$this->method = $request::get_method();
	
	if (empty($this->method)) {
		throw new $exception('unknown http method', $response::STATUS_METHOD_NOT_ALLOWED);
	}
}
743877
protected function init()
    {
        if ($this->request->getResponseFormat() == 'xml') {
            $aggregated = new \SimpleXMLElement('<response/>');
            foreach ($this->responseRaw as $name => $response) {
                $child = $aggregated->addChild('classification');
                $child->addAttribute('classifier', $name);
                $xml = simplexml_load_string($response);

                if (! $xml instanceof \SimpleXMLElement) {
                    throw new ServiceReaderException('Failed parsing XML response.');
                }

                if ((string) $xml->status->attributes()->success !== 'true') {
                    throw new ServiceReaderException($xml->status->attributes()->statusCode);
                }

                foreach ($xml->readCalls->classify as $classify) {
                    $child->addAttribute('textCoverage', $classify->classification->attributes()->textCoverage);
                    foreach ($classify->classification->class as $class) {
                        $this->simplexmlImportXml($child, $class->asXML());
                    }
                }
            }

            return $aggregated->asXML();
        }

        if ($this->request->getResponseFormat() == 'json') {
            $aggregated = array();
            foreach ($this->responseRaw as $name => $response) {
                $current = json_decode($response, 1);

                if (! array_key_exists('success', $current)) {
                    throw new ServiceReaderException('Unable to complete request');
                }

                if ($current['success'] !== true) {
                    throw new ServiceReaderException($current['statusCode'] . ' ' . $current['errorMessage']);
                }

                array_key_exists('textCoverage', $current) ? '' : $current['textCoverage'] = null;
                array_key_exists('cls1', $current) ? '' : $current['cls1'] = null;

                $aggregated[] = array(
                    'classifier' => $name,
                    'textCoverage' => $current['textCoverage'],
                    'classes' => $current['cls1']
                );
            }

            return json_encode($aggregated);
        }

        return $this->responseRaw;
    }
1274413
public function rest_api_init() {
		$register = [];
		foreach ( [ 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTION' ] as $method ) {
			$method_name = strtolower( "handle_{$method}" );
			if ( ! method_exists( $this, $method_name ) ) {
				continue;
			}
			$register[] = [
				'methods' => $method,
			    'callback' => [ $this, 'invoke' ],
			    'args'     => $this->get_arguments( $method ),
			    'permission_callback' => [ $this, 'permission_callback' ],
			];
		}
		if ( ! $register ) {
			throw new \Exception( sprintf( 'Class %s has no handler.', get_called_class() ), 500 );
		} else {
			register_rest_route( $this->namespace, $this->get_route(), $register );
		}
	}
1350061
public function request()
    {
        $data = $this->prepareData();

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $this->apiHost . '/api');
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        $result = curl_exec($ch);
        $this->checkResult($result);

        return $result;
    }