PHP用、外部接続にcURLかfsockopenが選べるHTTPクラス
2008年01月22日-
スポンサード リンク
HTTP Class for PHP (supports both cURL and fsockopen) | Md Emran Hasan aka phpfour
This is a wrapper HTTP class that uses either cURL or fsockopen to harvest resources from the web.
PHP用、外部接続にcURLかfsockopenが選べるHTTPクラス。
次のようにPEARレスでシンプルに使えます。
<?php
include_once('class.http.php');
$http = new Http();
$http->useCurl(false);
$http->setMethod('POST');
$http->addParam('user_name', 'emran');
$http->addParam('password', 'hasan');
$http->setReferrer('https://someproject.projectpath.com/login');
$http->execute('https://someproject.projectpath.com/login/authenticate');
echo ($http->error) ? $http->error : $http->result;
?>
リファラ送りやBasic認証、リダイレクト回数設定、クッキー制御などの基本的な機能にも対応しています。
ドキュメントはこちら
関連エントリ
スポンサード リンク
Advertisements
SITE PROFILE
最新のブログ記事(新着順)
- CSSのみで実現できるローディングアニメーションやエフェクト集「Css Effects」
- スムーズに横スクロールするレイアウトサンプル
- 斬新なページメニューが作れる「Inline Menu Layout with Gallery Panel」
- 世界中で今何時を計算できる「Spacetime」
- シンプルなタブUIを実現できる「Skeletabs」
- テキストを省略してブロックを小さくできる「Cuttr.js」
- インタラクティブに動く立体的なテキストを生成「ztext.js」
- WebGLを使った動画の切り替えアニメーション実装
- スクロールにあわせて動くイメージタイル実装
- 1000以上の汎用アイコンセット「emblemicons」
- 過去のエントリ