https://github.com/webfiori/http
HTTP handling helper library of WebFiori Framework.
https://github.com/webfiori/http
hacktoberfest php php-library rest-api web
Last synced: 8 months ago
JSON representation
HTTP handling helper library of WebFiori Framework.
- Host: GitHub
- URL: https://github.com/webfiori/http
- Owner: WebFiori
- License: mit
- Created: 2018-03-06T09:32:25.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-12-24T20:07:54.000Z (12 months ago)
- Last Synced: 2025-04-23T21:46:47.831Z (8 months ago)
- Topics: hacktoberfest, php, php-library, rest-api, web
- Language: PHP
- Homepage:
- Size: 657 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# WebFiori HTTP
A simple library for creating RESTful web APIs in adition to providing utilities for handling HTTP request and response.
It includes inputs feltering and data validation in addion to creating user-defined inputs filters.
## Supported PHP Versions
| Build Status |
|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|
|
|
|
|
|
|
|
|
## API Docs
This library is a part of WebFiori Framework. To access API docs of the library, you can visid the following link: https://webfiori.com/docs/webfiori/http .
## Terminology
Following terminology is used by the library:
| Term | Definition|
|:------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| Web Service | A single end pont that implements a REST service. It is represented as an instance of the class `AbstractWebService`. |
| Services Manager | An entity which is used to manage a set of web services. Represented by the class `WebServicesManager`. |
| Request Parameter | A way to pass values from a client such as a web browser to the server. Represented by the class `RequestParameter`. |
## The Idea
The idea of the library is as follows, when a client performs a request to a web service, he is usually intersted in performing specific action. Related actions are kept in one place as a set of web services (e.g. CRUD operations on a reasorce). The client can pass arguments (or parameters) to the end point in request body as `POST` or `PUT` request method or as a query string when using `GET` or `DELETE`.
An end point is represented by the class [`AbstractWebService`](https://webfiori.com/docs/webfiori/http/AbstractWebService) and a set of web service (or end ponts) are grouped using the class [`WebServicesManager`](https://webfiori.com/docs/webfiori/http/WebServicesManager). Also, body parameters represented by the class [`RequestParameter`](https://webfiori.com/docs/webfiori/http/RequestParameter).
## Features
* Full support for creating REST services that supports JSON as request and response.
* Support for basic data filtering and validation.
* The ability to create custom filters based on the need.
## Installation
If you are using composer to collect your dependencies, you can simply include the following entry in your 'composer.json' file to get the latest release of the library:
``` json
{
"require": {
"webfiori/http":"*"
}
}
```
Note that the WebFiori Json library will be included with the installation files as this library is depending on it.
Another option is to download the latest release manually from Release.
## Usage
For more information on how to use the library, [check here](https://github.com/WebFiori/wf-docs/blob/master/web-services.md)