PHPackages                             asgard/http - 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. asgard/http

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

asgard/http
===========

v0.3.1(10y ago)01.3k5MITPHPPHP &gt;=5.5.9

Since Sep 9Pushed 7y agoCompare

[ Source](https://github.com/asgardphp/http)[ Packagist](https://packagist.org/packages/asgard/http)[ RSS](/packages/asgard-http/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (7)Versions (5)Used By (5)

\#HTTP

[![Build Status](https://camo.githubusercontent.com/8971c77b787ab26c0fed882ea1cf460d464bed206d866f8d86c3607ab92dd7f8/68747470733a2f2f7472617669732d63692e6f72672f6173676172647068702f687474702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/asgardphp/http)

Library to handle HTTP requests, routing, controllers and responses.

\##Installation **If you are working on an Asgard project you don't need to install this library as it is already part of the standard libraries.**

```
composer require asgard/http 0.*

```

\##Request &amp; Response

Handling HTTP requests and building responses. [See the documentation.](docs/http-requestresponse)

```
$request = \Asgard\Http\Request::createFromGlobals();
//...
return (new \Asgard\Http\Response)->setCode(404)->setContent('not found :(');

```

\##Controllers

Structure your code around controllers. [See the documentation.](docs/http-controllers)

```
/**
 * @Prefix("products")
 */
class ProductController extends \Asgard\Http\Controller {
	/**
	 * @Prefix("index")
	 */
	public function indexAction(\Asgard\Http\Request $request) {
		//...
	}

	/**
	 * @Prefix("search")
	 */
	public function searchAction(\Asgard\Http\Request $request) {
		//...
	}
}

```

\##Utils

The package comes with tools. [See the documentation.](docs/http-utils)

\###HTML

```
#in the controller or the page view
$html->includeJS('query.js');
$html->includeCSS('style.css');

#in the layout view
$html->printAll();

```

\###Flash

```
#in the controller
$flash->addSuccess('Hurray!);

#in the view
$flash->showAll();

```

\###Browser

```
$browser = new \Asgard\Http\Browser\Browser($httpKernel, $container);
$browser->getSession()->set('admin_id', 123);

$response = $browser->post('admin/news/new', ['title'=>'foo']);

if($response->getCode() !== 200)
	echo 'error..';
else
	echo $response->getContent();

```

\##Commands

[List of commands that come with the HTTP package.](docs/http-commands)

\###Contributing

Please submit all issues and pull requests to the [asgardphp/asgard](http://github.com/asgardphp/asgard) repository.

### License

[](#license)

The Asgard framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~204 days

Total

4

Last Release

3654d ago

PHP version history (2 changes)v0.1.0PHP &gt;=5.4.0

v0.3.0PHP &gt;=5.5.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/849017ae3ff0c90a272e935f9c1db9a64692db4a2a18a8d0e4bf9dbcd6f74e2c?d=identicon)[leyou](/maintainers/leyou)

---

Top Contributors

[![h0gar](https://avatars.githubusercontent.com/u/439138?v=4)](https://github.com/h0gar "h0gar (165 commits)")

### Embed Badge

![Health badge](/badges/asgard-http/health.svg)

```
[![Health](https://phpackages.com/badges/asgard-http/health.svg)](https://phpackages.com/packages/asgard-http)
```

###  Alternatives

[handcraftedinthealps/rest-routing-bundle

This bundle provides automatic route registration for the Controllers

582.0M2](/packages/handcraftedinthealps-rest-routing-bundle)[retailcrm/api-client-php

PHP client for RetailCRM API

68981.8k1](/packages/retailcrm-api-client-php)[aboutcoders/job-bundle

A symfony bundle for asynchronous job processing.

2618.0k1](/packages/aboutcoders-job-bundle)[deviantintegral/har

A PHP library for working with HTTP Archives

1311.8k](/packages/deviantintegral-har)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
