vincet/url-opener 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vincet/url-opener

Composer 安装命令:

composer require vincet/url-opener

包简介

Url Opener for PHP 5.3

README 文档

README

Library to load page throught HTTP. It supports GET and POST requests and handle Cookie management

<?php

require_once 'path/to/UrlOpener/src/autoload.php';

use VinceT\UrlOpener\UrlOpener;
use VinceT\UrlOpener\Http\Header\RequestHeaderBag;

// use config to set specific options
// default values are:
$config = array(
    'USE_CURL' => false, // set to true to use curl instead of file_get_contents
    'USE_IP' => false, // if you want to make requests from a specific IP, give the ip address to use
    'COOKIE_FILE' => null, // if you want to store cookies into a file, give the file name
);

$urlOpener = new UrlOpener($config);

$postDatas = array(
    'my_var' => 'the value',
);

$headers = new RequestHeaderBag();
$headers->setUserAgent('My user agent string');

$response = $urlOpener->open('http://www.example.com', $postDatas, $headers);

print $response->getContent();

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-01-06