Project

tilia-http

0.0
Low commit activity in last 3 years
A long-lived project that still receives updates
Port of the sabre-http library to ruby. The tilia_http library provides utilities for dealing with http requests and responses.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.6
~> 1.6
~> 1.0
~> 1.4
 Project Readme

tilia/http

Build Status

tilia/http is a port of sabre/http

The sabre/http library provides a toolkit to make working with the HTTP protocol easier.

Most PHP scripts run within a HTTP request but accessing information about the HTTP request is cumbersome at least.

There's bad practices, inconsistencies and confusion. This library is effectively a wrapper around the following PHP constructs:

For Input:

  • $_GET,
  • $_POST,
  • $_SERVER,
  • php://input or $HTTP_RAW_POST_DATA.

For output:

  • php://output or echo,
  • header().

What this library provides, is a Request object, and a Response object.

The objects are extendable and easily mockable.

Installation

Simply add tilia-http to your Gemfile and bundle it up:

  gem 'tilia-http', '~> 4.1'

Changes to sabre/http

  Sabre\HTTP\Message#setHeader($name, $value)
  Sabre\HTTP\Message#setHeader(array $headers)

are replaced by

  Tilia::Http::Message#update_header(name, value)
  Tilia::Http::Message#update_headers(headers)

Contributing

See Contributing

License

tilia-http is licensed under the terms of the three-clause BSD-license.