PHPackages                             royers/phgo - 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. royers/phgo

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

royers/phgo
===========

A simple php library for managing http requests based on the net/http package from golang standard library

1.0.0(8mo ago)12MITPHP

Since Aug 23Pushed 8mo agoCompare

[ Source](https://github.com/RoY3rS04/PhGo)[ Packagist](https://packagist.org/packages/royers/phgo)[ RSS](/packages/royers-phgo/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

PhGo
====

[](#phgo)

A lightweight go-like HTTP library for PHP.

Installation
------------

[](#installation)

```
composer require royers/phgo
```

Usage
-----

[](#usage)

In order to be able to use this package you'll need to use these components:

- A ServeMux object.
- Your own functions which will be injected a Response and Request object by default.

### Example on how to register a route

[](#example-on-how-to-register-a-route)

This simple example will show you how to access dynamic parameters and writing response headers.

Let's suppose we have a project that has this structure:

```
├──public
│   └──index.php
├──src
├──vendor
├──composer.json
├──blogs.json

```

**public/index.php**

```
