phpWebHacksPHP的HTTP客户端
phpWebHacks 是一个采用PHP开发的高级的HTTP客户端,你只需要数行代码就可以用来模拟浏览器的真实访问行为而无需键盘和鼠标的动作。可以用它来完成HTTP的调试功能。
示例代码
<?php
include 'phpWebHacks.php';
$h = new phpWebHacks;
$page = $h->get('http://webmail.example.com');
include 'phpWebHacks.php';
$h = new phpWebHacks;
$page = $h->get('http://webmail.example.com');
/* username & password */
$form['login_username'] = 'myusername';
$form['login_domain'] = 'example.com';
$form['secretkey'] = 'mypassword';
/* login */
$page = $h->post('redirect.php', $form);
$form['login_username'] = 'myusername';
$form['login_domain'] = 'example.com';
$form['secretkey'] = 'mypassword';
/* login */
$page = $h->post('redirect.php', $form);
>
评论