Skip to content

A requests library whose API is based off of python-requests.org

License

Notifications You must be signed in to change notification settings

lonnylot/requests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reqests

Based on Kenneth Reitz API for requests

Current Status

Unstable - In Development

Installation

Composer

Examples

GET Request

<?php

// Require a PSR-0 compliant autoloader
require './vendor/autoload.php';
// Require the Requests API
require 'lib/Requests/Api.php';

$response = Requests\Get("https://www.google.com/robots.txt");
if ($response->isOk()) {
    echo $response->body;
}

POST Request

<?php

// Require a PSR-0 compliant autoloader
require './vendor/autoload.php';
// Require the Requests API
require 'lib/Requests/Api.php';

$response = Requests\Post("https://www.gmail.com/", ["data"=>["foo"=>"bar"]]);
if ($response->isOk()) {
    echo "The response content-type is " . $response->headers["content-type"];
}

About

A requests library whose API is based off of python-requests.org

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages