2017 © Pedro Peláez
 

library http

HTTP protocol support for the XP Framework

image

xp-framework/http

HTTP protocol support for the XP Framework

  • Monday, April 2, 2018
  • by thekid
  • Repository
  • 3 Watchers
  • 1 Stars
  • 39,765 Installations
  • PHP
  • 8 Dependents
  • 0 Suggesters
  • 0 Forks
  • 9 Open issues
  • 22 Versions
  • 8 % Grown

The README.md

HTTP protocol support for the XP Framework

Build status on GitHub XP Framework Module BSD Licence Requires PHP 7.0+ Supports PHP 8.0+ Latest Stable Version, (*1)

Implements HTTP (HyperText Transfer Protocol) and provides a client to interact with HTTP servers. The HttpConnection is the entry point class., (*2)

Methods

Different request methods are handled by HttpConnection class methods as follows:, (*3)

  • GET - via get()
  • POST - via post()
  • HEAD - via head()
  • PUT - via put()
  • PATCH - via patch()
  • DELETE - via delete()
  • OPTIONS - via options()
  • TRACE - via trace()

Other methods (e.g. MKCOL from WebDAV) are supported via request()., (*4)

Headers

The following code will show the response headers for a HEAD request:, (*5)

use peer\http\HttpConnection;

$c= new HttpConnection('http://xp-framework.net/');
Console::writeLine($c->head());

Getting data

with ($c= new HttpConnection('http://xp-framework.net/')); {
  $response= $c->get();
  Console::writeLine('Response: ', $response);

  $in= $response->in();
  while ($in->available()) {
    $bytes= $in->read();
  }
}

SSL support

This API also supports SSL connections - based on the scheme given to HttpConnection's constructor the HttpRequestFactory class will create an SSL connection. This is transparent from the outside, the rest of the calls are the same!, (*6)

Example:, (*7)

$c= new HttpConnection('https://example.com/');

Note: SSL connections depend on either the PHP extension curl or openssl., (*8)

The Versions

02/04 2018
07/10 2017

dev-feature/keep-alive

dev-feature/keep-alive http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

29/08 2016

v8.0.1

8.0.1.0 http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

28/08 2016

v8.0.0

8.0.0.0 http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

17/06 2016

dev-feature/accept-paths

dev-feature/accept-paths http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

10/06 2016

v7.0.1

7.0.1.0 http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

21/02 2016

v7.0.0

7.0.0.0 http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

23/01 2016

v6.2.1

6.2.1.0 http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

20/12 2015

v6.2.0

6.2.0.0 http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

08/12 2015

v6.1.3

6.1.3.0 http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

26/09 2015

v6.1.2

6.1.2.0 http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

12/07 2015

v6.1.1

6.1.1.0 http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

28/04 2015

v6.1.0

6.1.0.0 http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

28/04 2015

dev-fix/http-delete

dev-fix/http-delete http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

14/04 2015

dev-feature/digest-auth-squash

dev-feature/digest-auth-squash http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

09/04 2015

dev-feature/digest-auth

dev-feature/digest-auth http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

27/02 2015

dev-feature/cookie-handling

dev-feature/cookie-handling http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

12/02 2015

v6.0.1

6.0.1.0 http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

10/01 2015

v6.0.0

6.0.0.0 http://xp-framework.net/

HTTP protocol support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp