2017 © Pedro Peláez
 

library simple-http

Simple wrapper for cURL for basic requests

image

gatorv/simple-http

Simple wrapper for cURL for basic requests

  • Friday, August 18, 2017
  • by gatorv
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

SimpleHttpRequest Class

Simple PHP Http Request Wrapper using cURL under the hood., (*1)

Installation

$ php composer.phar require gatorv/simple-http

Usage

Basic Usage, (*2)

use Gatorv\Web\SimpleHttpRequest as Request;

$req = new Request();
list($headers, $body) = $req->get('https://url/');

Main Methods

Perform a GET Request, (*3)

$req->get($url); 

Perform a POST Request:, (*4)

$req->post($url, $data); 

Methods

The following options can be customized on constructing the object (or after construction: 1. redirects - The number of redirects to perform if a Location header is sent. 1. proxy - The proxy and port to use 1. ssl - Wether to verify the SSL certificate or not (for testing), (*5)

Also the following methods are available:, (*6)

Use a Desktop User-Agent:, (*7)

$req->useDesktopAgent(); 

Use a Mobile User-Agent:, (*8)

$req->useMobileAgent(); 

Reset Headers:, (*9)

$req->resetHeaders(); 

Request Compression:, (*10)

$req->requestCompression(); 

Add a HTTP Cookie:, (*11)

$req->addCookie(); 

The Versions

18/08 2017

dev-master

9999999-dev

Simple wrapper for cURL for basic requests

  Sources   Download

The Requires

  • ext-curl *

 

The Development Requires

by Christopher Valderrama

curl http request