2017 © Pedro Peláez
 

library http

Hypertext Transfer Protocol (HTTP) utilities for PHP

image

delight-im/http

Hypertext Transfer Protocol (HTTP) utilities for PHP

  • Wednesday, January 24, 2018
  • by delight-im
  • Repository
  • 5 Watchers
  • 6 Stars
  • 33,976 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 23 % Grown

The README.md

PHP-HTTP

Hypertext Transfer Protocol (HTTP) utilities for PHP, (*1)

Requirements

  • PHP 5.3.0+

Installation

  1. Include the library via Composer [?]:, (*2)

    $ composer require delight-im/http
    
  2. Include the Composer autoloader:, (*3)

    require __DIR__ . '/vendor/autoload.php';
    

Usage

Response headers

  • Retrieving a header (with optional value prefix), (*4)

    $header = \Delight\Http\ResponseHeader::get('Content-Type');
    // or
    $header = \Delight\Http\ResponseHeader::get('Content-Type', 'text/');
    
  • Setting a header (overwriting other headers with the same name), (*5)

    \Delight\Http\ResponseHeader::set('X-Frame-Options', 'sameorigin');
    
  • Adding a header (preserving other headers with the same name), (*6)

    \Delight\Http\ResponseHeader::add('Vary', 'User-Agent');
    
  • Removing a header (with optional value prefix), (*7)

    $success = \Delight\Http\ResponseHeader::remove('X-Powered-By');
    // or
    $success = \Delight\Http\ResponseHeader::remove('X-Powered-By', 'PHP');
    
  • Retrieving and removing a header at once (with optional value prefix), (*8)

    $header = \Delight\Http\ResponseHeader::take('Set-Cookie');
    // or
    $header = \Delight\Http\ResponseHeader::take('Set-Cookie', 'mysession=');
    

Contributing

All contributions are welcome! If you wish to contribute, please create an issue first so that your feature, problem or question can be discussed., (*9)

License

This project is licensed under the terms of the MIT License., (*10)

The Versions

24/01 2018

dev-master

9999999-dev https://github.com/delight-im/PHP-HTTP

Hypertext Transfer Protocol (HTTP) utilities for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

https http headers

21/07 2016

v2.0.0

2.0.0.0 https://github.com/delight-im/PHP-HTTP

Hypertext Transfer Protocol (HTTP) utilities for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

https http headers

08/07 2016

v1.1.0

1.1.0.0 https://github.com/delight-im/PHP-HTTP

Hypertext Transfer Protocol (HTTP) utilities for PHP

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0

 

https http headers

09/06 2016

v1.0.0

1.0.0.0 https://github.com/delight-im/PHP-HTTP

Hypertext Transfer Protocol (HTTP) utilities for PHP

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0

 

https http headers