2017 © Pedro Peláez
 

library lib-http

HTTP library of the Ride framework

image

ride/lib-http

HTTP library of the Ride framework

  • Thursday, June 1, 2017
  • by ride-user
  • Repository
  • 7 Watchers
  • 0 Stars
  • 4,134 Installations
  • PHP
  • 34 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 41 Versions
  • 2 % Grown

The README.md

Ride: HTTP Library

HTTP library of the PHP Ride framework., (*1)

This library helps you when working with the HTTP protocol. It contains classes to work with requests, responses, headers, cookies, sessions and data URI's., (*2)

Code Sample

Check this code sample to see the possibilities of this library:, (*3)

<?php

use ride\library\http\session\Session;
use ride\library\http\HttpFactory;

$httpFactory = new HttpFactory();

$request = $httpFactory->createRequestFromServer();
$response = $httpFactory->createResponse();

// basic request
$request->getMethod();
$request->isGet();
$request->isPost();
$request->getQueryParameter('variable'); 
$request->getBodyParameter('variable'); 
$request->getCookie('variable');
$request->getHeader('variable');

// request headers
$request->getUserAgent();
$request->getAccept();
$request->getAcceptCharset();
$request->getAcceptEncoding();
$request->getAcceptLanguage();
$request->getIfNoneMatch();
$request->getIfModifiedSince();
$request->isXmlHttpRequest();
$request->isNoCache();

// sessions
$request->setSession(new Session());

if ($request->hasSession()) {
    $session = $request->getSession();
    $session->get('variable');
}

// basic response
$response->setBody('{"variable":"value"}');
$response->setHeader('content-type', 'application/json');
$response->setCookie($httpFactory->createCookie('myCookie', 'value'));

// redirection
$response->setRedirect('http://server');
if ($response->willRedirect()) {
    $response->getLocation();
    $response->clearRedirect();
}

// handle caching
$response->setIsPrivate();
$response->setIsPublic();
$response->setNoCache();
$response->setNoStore();
$response->setExpires(time() + 50);
$response->setMaxAge(60);
$response->setSharedMaxAge(3600);

// handle not modified
$response->setLastModified(time());
$response->setETag('abc');

if ($response->isNotModified($request)) {
    $response->setNotModified();
}

// send a response
$response->send($request);

// working with data URI's
$dataUri = $httpFactory->createDataUri('Hello, World!', 'text/plain', null, true);
$dataUri->encode(); // 'data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D'

$dataUri = $httpFactory->createDataUriFromString($dataUri->encode());
$dataUri->getValue(); // Hello, World!

Installation

You can use Composer to install this library., (*4)

composer require ride/lib-http

The Versions

01/06 2017

dev-develop

dev-develop

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

01/06 2017

dev-master

9999999-dev

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

01/06 2017

1.2.3

1.2.3.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

30/05 2017

1.2.2

1.2.2.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

28/03 2017

1.2.1

1.2.1.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

05/01 2017

1.2.0

1.2.0.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

08/09 2016

1.0.1

1.0.1.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

10/08 2016

1.1.0

1.1.0.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

10/08 2016

dev-release/1.1.0

dev-release/1.1.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

22/06 2016

1.0.0

1.0.0.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

19/02 2016

0.6.0

0.6.0.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

04/01 2016

0.5.7

0.5.7.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

04/01 2016

0.5.6

0.5.6.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

27/11 2015

dev-release/0.5.5

dev-release/0.5.5

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

21/11 2015

0.5.4

0.5.4.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

20/11 2015

0.5.3

0.5.3.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

14/10 2015

0.5.2

0.5.2.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

01/10 2015

0.5.1

0.5.1.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

03/09 2015

0.5.0

0.5.0.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

11/08 2015

0.4.1

0.4.1.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

11/08 2015

0.4.0

0.4.0.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

07/08 2015

0.3.18

0.3.18.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

02/07 2015

0.3.17

0.3.17.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

02/07 2015

0.3.16

0.3.16.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

16/06 2015

0.3.15

0.3.15.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

29/05 2015

0.3.14

0.3.14.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

28/04 2015

0.3.13

0.3.13.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

28/04 2015

0.3.12

0.3.12.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

28/04 2015

0.3.11

0.3.11.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

28/04 2015

0.3.10

0.3.10.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

05/03 2015

0.3.9

0.3.9.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

28/02 2015

0.3.8

0.3.8.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

26/02 2015

0.3.7

0.3.7.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

25/11 2014

0.3.6

0.3.6.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

22/10 2014

0.3.5

0.3.5.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

26/06 2014

0.3.4

0.3.4.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

23/02 2014

0.3.3

0.3.3.0

HTTP library of the Ride framework

  Sources   Download

MIT

by Joris Vandeweerd

18/02 2014

0.3.2

0.3.2.0

HTTP library of the Pallo framework

  Sources   Download

MIT

by Joris Vandeweerd

18/02 2014

0.3.1

0.3.1.0

HTTP library of the Pallo framework

  Sources   Download

MIT

by Joris Vandeweerd

11/01 2014

0.3.0

0.3.0.0

HTTP library of the Pallo framework

  Sources   Download

MIT

by Joris Vandeweerd

10/01 2014

0.2.4

0.2.4.0

HTTP library of the Pallo framework

  Sources   Download

MIT

by Joris Vandeweerd