Exemple #1
0
<?php

include '../lib/httpful.phar';
$email = $_POST['email'];
$nome = $_POST['nome'];
$sobrenome = $_POST['sobrenome'];
$senha = $_POST['password'];
$url = "localhost:5000/validaemail/bob@example.com";
$response = Httpful\Request::get('http://example.com')->send();
Exemple #2
0
        $uri = $_POST['url'];
        $ifacetype = 'web';
    } else {
        die($form);
    }
}
$uri .= '/feed/custom/3304/?include_variants=true&limit=500&page=';
$zip = new ZipArchive();
$tmpZipfileName = tempnam(sys_get_temp_dir(), 'SEOZIP') . '.zip';
$res = $zip->open($tmpZipfileName, ZipArchive::CREATE);
if ($res !== true) {
    die('Unable to create zip');
}
$page = 1;
do {
    $response = Httpful\Request::get($uri . $page)->followRedirects()->send();
    $returnCode = (int) $response->code;
    if ($returnCode == 200) {
        $zip->addFromString($page . '.xml', $response->raw_body);
        $page++;
    }
} while ($returnCode == 200);
$zip->close();
if ($ifacetype == 'cli') {
    rename($tmpZipfileName, realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . time() . '.zip');
} else {
    header('Content-Description: File Transfer');
    header('Content-Type: application/octet-stream');
    header('Content-Disposition: attachment; filename="' . basename($tmpZipfileName) . '"');
    header('Expires: 0');
    header('Cache-Control: must-revalidate');
 /**
  * Reset extra server configuration.
  */
 public static function resetExtraConfig()
 {
     $url = Config::read('passbolt.url') . DS . '/seleniumTests/resetExtraConfig';
     $request = Httpful\Request::post($url);
     $request->sendsType(Httpful\Mime::JSON)->send();
 }