These codes throw "Bad Request" error because of parameter. What is the problem of parameter syntax.
try{
$client = new Client();
$response = $client->post("url",
['s' => $s, 'p'=> $p]);
} catch (ClientException $e) {
echo $e->getMessage();
} catch (RequestException $e) {
echo $e->getMessage();
}