2017 © Pedro Peláez
 

library http-headers

WTHeaders is a qvalue? Don't worry, we got that for you!

image

trii/http-headers

WTHeaders is a qvalue? Don't worry, we got that for you!

  • Wednesday, May 13, 2015
  • by Trii
  • Repository
  • 2 Watchers
  • 1 Stars
  • 28 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 4 % Grown

The README.md

http-headers - The HTTP Header parsing library for PHP

Build Status, (*1)

Accept: text/feedback, application/pull-requests, (*2)

SHOULD be interpreted as "This is a work in progress. Early feedback and pull requests are accepted", (*3)

HTTP is hard and you're probably dealing with headers the wrong way. Do you know what Accept-Encoding: identity means? What about a qvalue? How about this nonsense:, (*4)

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,application/json

We didn't think so but guess what? You don't have to! That is right, http-headers can parse this for you and just let you know if the requestor accepts what you want to give them and even ask which one they prefer., (*5)

Check out how easy this is!, (*6)

use Trii\HTTPHeaders;

$accept = new HTTPHeaders\Accept('audio/*; q=0.2, audio/basic');

var_dump($accept->isAccepted('audio/mpeg'));
// bool(true)

var_dump($accept->getPreferredType());
// string(11) "audio/basic"

Awesome right?!?, (*7)

The Versions

13/05 2015

dev-master

9999999-dev

WTHeaders is a qvalue? Don't worry, we got that for you!

  Sources   Download

BSD 3-Clause

The Requires

  • php >=5.4.0

 

The Development Requires

by Avatar Trii