PHPackages                             hvolschenk/http-request - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. hvolschenk/http-request

ActiveLibrary[HTTP &amp; Networking](/categories/http)

hvolschenk/http-request
=======================

PHP functional HTTPRequest library.

v0.2(8y ago)014MITPHPPHP ^7.0

Since Jun 8Pushed 8y ago1 watchersCompare

[ Source](https://github.com/hvolschenk/http-request)[ Packagist](https://packagist.org/packages/hvolschenk/http-request)[ Docs](https://github.com/hvolschenk/http-request)[ RSS](/packages/hvolschenk-http-request/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Hvolschenk\\HTTPRequest
=======================

[](#hvolschenkhttprequest)

A simple functional PHP library to work with the current http request

Installation:
-------------

[](#installation)

```
php composer.phar require hvolschenk\http-request

```

Functions:
----------

[](#functions)

#### GET()

[](#get)

Returns the list of query string parameters. Returns an empty array if none are available.

```
GET(void): array;
```

#### GETKey()

[](#getkey)

Returns the value of a single key in the list of query string parameters. Returns an empty string if the key is not available.

```
GETKey(string $key): string;
```

#### headers()

[](#headers)

Returns the list of HTTP request headers. Returns an empty array if none are available.

```
headers(void): array;
```

#### headersKey()

[](#headerskey)

Returns the value of a single key in the list of HTTP request headers. Returns an empty string if the key is not available.

```
headersKey(string $key): string;
```

#### POST()

[](#post)

Returns the POST body. Returns an empty array if it is not available.

```
POST(void): array;
```

#### POSTKey()

[](#postkey)

Returns the value of a single key in the POST body. Returns an empty string if the key is not available.

```
POSTKey(string $key): string;
```

Usage example:
--------------

[](#usage-example)

```
