Thttpclient Failed To Open Stream: Http Request Failed! Http/1.1 400 Bad Request
This is my code in Python to connect to the server which works very well. transport = THttpClient.THttpClient(secureUrl) protocol = TBinaryProtocol.TBinaryProtocol(transport) clien
Solution 1:
Here was the issue with the THttpClient call. The first parameter should be the host and the uri should be in the 3rd parameter.
so the exact way to call it is
$result = json_decode(exec('./Authenticator.py'));
$liveURL = $result->secureUrl;
$liveURI = preg_replace('#^https?://edenremote.paceap.com#', '', rtrim($result->secureUrl,'/'));
$socket = new THttpClient('edenremote.paceap.com', 80, $liveURI, 'https');
$socket->setTimeoutSecs(50);
$transport = new TBufferedTransport($socket, 1024, 1024);
$protocol = new TBinaryProtocol($transport);
$client = new \edenremotephp\pub\EdenRemote\EdenRemoteClient($protocol);
$transport->open();
$client->openSession($result->sessionID, 1);
$isExist = $client->findUserByEmailAddress($result->sessionID, $account->primaryEmail);
var_dump($isExist);
$client->closeSession($result->sessionID);
echo'Done';
Post a Comment for "Thttpclient Failed To Open Stream: Http Request Failed! Http/1.1 400 Bad Request"