PHPackages                             aidan-casey/http-parser - 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. [Database &amp; ORM](/categories/database)
4. /
5. aidan-casey/http-parser

ActiveLibrary[Database &amp; ORM](/categories/database)

aidan-casey/http-parser
=======================

Various tools for parsing HTTP requests into API usable queries.

v1.2.1(7y ago)221MITPHP

Since Sep 4Pushed 7y ago1 watchersCompare

[ Source](https://github.com/aidan-casey/http-parser)[ Packagist](https://packagist.org/packages/aidan-casey/http-parser)[ RSS](/packages/aidan-casey-http-parser/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (3)Versions (4)Used By (0)

This package provides various classes that help convert a PSR representation of an HTTP request into other forms useful for an API server.

For example, the `HttpToZend` class will convert HTTP parameters into a database query that can be passed to your model for serving up information or carrying out actions.

Install
=======

[](#install)

Coming soon! For now, feel free to clone this repository.

HttpToZend
==========

[](#httptozend)

Supported GET Parameters / request methods
------------------------------------------

[](#supported-get-parameters--request-methods)

ParameterRequest MethodValuefieldsSELECTStringfilterDELETE, SELECT, PATCH, PUTJSONorderbySELECTJSONlimitSELECTIntegeroffsetSELECTInteger### Fields

[](#fields)

`fields=ID, Name`

### Filter

[](#filter)

```
filter={
    "ID": {
        "$gte" : 4
    },
    "Name": "Example"
}
```

#### Supported Filters

[](#supported-filters)

NameKeyValueGreater Than$gtIntegerGreater Than or Equal To$gteIntegerIn$inArrayNot In$ninArrayLike$likeStringNot Like$nlikeStringLess Than$ltIntegerLess Than or Equal To$lteIntegerNot$notString### Order By

[](#order-by)

```
orderby={
    "Name": "ASC",
    "ID": "DESC"
}
```

### Limit

[](#limit)

`limit=20`

### Offset

[](#offset)

`offset=20`

Example
-------

[](#example)

This example uses Slim Framework and converts a GET request into a database select query.

```
