src/OpenTok/Util/Client.php
public function createSession($options)
    {
        $request = new Request('POST', '/session/create');
        try {
            $response = $this->client->send($request, [
                'debug' => $this->isDebug(),
                'form_params' => $this->postFieldsForOptions($options)
            ]);
            $sessionXml = $this->getResponseXml($response);
        } catch (\RuntimeException $e) {
            // TODO: test if we have a parse exception and handle it, otherwise throw again
            throw $e;
        } catch (\Exception $e) {
            $this->handleException($e);
            return;
        }
        return $sessionXml;
    }
public function createSession($options)
    {
        $request = new Request('POST', '/session/create');
        try {
            $response = $this->client->send($request, [
                'debug' => $this->isDebug(),
                'form_params' => $this->postFieldsForOptions($options)
            ]);
            $sessionXml = $this->getResponseXml($response);
        } catch (\RuntimeException $e) {
            // TODO: test if we have a parse exception and handle it, otherwise throw again
            throw $e;
        } catch (\Exception $e) {
            $this->handleException($e);
            return;
        }
        return $sessionXml;
    }
public function createSession ( $ options ) { $ request = new Request ( 'POST' , '/session/create' ) ; try { $ response = $ this -> client -> send ( $ request , [ 'debug' => $ this -> isDebug ( ) , 'form_params' => $ this -> postFieldsForOptions ( $ options ) ] ) ; $ sessionXml = $ this -> getResponseXml ( $ response ) ; } catch ( \ RuntimeException $ e ) { // TODO: test if we have a parse exception and handle it, otherwise throw again throw $ e ; } catch ( \ Exception $ e ) { $ this -> handleException ( $ e ) ; return ; } return $ sessionXml ; }
General API Requests
General API Requests