Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aportela/httprequest-wrapper
Custom php (curl) http request wrapper
https://github.com/aportela/httprequest-wrapper
composer-package curl http http-client php php8
Last synced: 1 day ago
JSON representation
Custom php (curl) http request wrapper
- Host: GitHub
- URL: https://github.com/aportela/httprequest-wrapper
- Owner: aportela
- License: agpl-3.0
- Created: 2022-04-18T20:22:16.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-24T20:19:46.000Z (about 1 month ago)
- Last Synced: 2024-12-25T10:47:52.188Z (10 days ago)
- Topics: composer-package, curl, http, http-client, php, php8
- Language: PHP
- Homepage:
- Size: 40 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# httprequest-wrapper
This is a simple library to wrap & manage native PHP HTTP requests (there are plenty of serious alternatives like [Guzzle](http://docs.guzzlephp.org/), this is my tiny approach to be used in some of my personal projects, should not be taken too seriously).
## Requirements
- mininum php version 8.x
- curl extension must be enabled## Limitations
At this time only GET/HEAD methods are supported.
## Install (composer) dependencies:
```
composer require aportela/httprequest-wrapper
```## Code example:
```
GET("https://packagist.org/packages/aportela/httprequest-wrapper");print_r($response);
```## Response object struct:
code: HTTP response code (int)
contentType: response content type (string)
headers: response headers (array)
body: response body contents![PHP Composer](https://github.com/aportela/httprequest-wrapper/actions/workflows/php.yml/badge.svg)