Skip to content

Commit

Permalink
Fix shields
Browse files Browse the repository at this point in the history
  • Loading branch information
seeren committed Jan 7, 2022
1 parent bbad1ac commit 9c79a5a
Showing 1 changed file with 30 additions and 47 deletions.
77 changes: 30 additions & 47 deletions README.md
@@ -1,24 +1,29 @@
# Seeren\Http
# Seeren\\Http

[![Build Status](https://travis-ci.org/seeren/http.svg?branch=master)](https://travis-ci.org/seeren/http) [![Coverage Status](https://coveralls.io/repos/github/seeren/http/badge.svg?branch=master)](https://coveralls.io/github/seeren/http?branch=master) [![Packagist](https://img.shields.io/packagist/dt/seeren/http.svg)](https://packagist.org/packages/seeren/http/stats) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/4a0463fb5a084be5bda68e4e36d7c7ac)](https://www.codacy.com/app/seeren/http?utm_source=github.com&utm_medium=referral&utm_content=seeren/http&utm_campaign=Badge_Grade) [![Packagist](https://img.shields.io/packagist/v/seeren/http.svg)](https://packagist.org/packages/seeren/http#) [![Packagist](https://img.shields.io/packagist/l/seeren/log.svg)](LICENSE)
[![Build](https://app.travis-ci.com/seeren/http.svg?branch=master)](https://app.travis-ci.com/seeren/http)
[![Require](https://poser.pugx.org/seeren/http/require/php)](https://packagist.org/packages/seeren/http)
[![Coverage](https://coveralls.io/repos/github/seeren/error/badge.svg?branch=master)](https://coveralls.io/github/seeren/http?branch=master)
[![Download](https://img.shields.io/packagist/dt/seeren/http.svg)](https://packagist.org/packages/seeren/http/stats)
[![Codacy](https://app.codacy.com/project/badge/Grade/baea2fa9ba704a80a6b693921af25cbd)](https://www.codacy.com/gh/seeren/http/dashboard?utm_source=github.com&utm_medium=referral&utm_content=seeren/http&utm_campaign=Badge_Grade)
[![Version](https://img.shields.io/packagist/v/seeren/http.svg)](https://packagist.org/packages/seeren/http)

Manage http messages

* * *

## Installation

Seeren\Http is a [PSR-7 http messages interfaces](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-7-http-message.md)
Seeren\\Http is a [PSR-7 http messages interfaces](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-7-http-message.md)
and a [PSR-18 http client interfaces](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-18-http-client-meta.md)
implementation

```
```bash
composer require seeren/http
```

## Seeren\Http\Client

Client representation
* * *

#### Seeren\Http\Client\Client
## Seeren\\Http\\Client

Retrieve response from sending request

Expand All @@ -34,38 +39,18 @@ $client = new Client('GET', new Uri(
echo $client->sendRequest()->getBody();
```

Specify headers and body in optional arguments

```php
use Seeren\Http\Client\Client;
use Seeren\Http\Uri\Uri;

$client = new Client(
'GET',
new Uri(
'https',
'packagist.org',
'packages/seeren/http.json'
),
['Accept' => 'application/json'],
'{}'
);
```
* * *

## Seeren\Http\Uri
## Seeren\\Http\\Uri

Uri representation

#### Seeren\Http\Uri\Uri

```php
use Seeren\Http\Uri\Uri;

$uri = new Uri('http', 'host');
```

#### Seeren\Http\Uri\RequestUri

Handle incoming request Uri

```php
Expand All @@ -74,34 +59,26 @@ use Seeren\Http\Uri\RequestUri;
$uri = new RequestUri();
```

## Seeren\Http\Stream
* * *

Resource representation

#### Seeren\Http\Stream\Stream
## Seeren\\Http\\Stream

Handle resource with open mode

```php
use Seeren\Http\Stream\Stream;

$stream = new Stream('some-url', Stream::MODE_R);
$content = (string)$stream;
echo new Stream('some-url', Stream::MODE_R);
```

#### Seeren\Http\Stream\RequestStream

Handle input for all http methods

```php
use Seeren\Http\Stream\RequestStream;

$stream = new RequestStream();
$input = (string) $stream;
echo new RequestStream();
```

#### Seeren\Http\Stream\ResponseStream

Handle output

```php
Expand All @@ -111,9 +88,11 @@ $stream = new ResponseStream();
$stream->write('Client output');
```

## Seeren\Http\Request\Request
* * *

## Seeren\\Http\\Request\\Request

Request with parsed json or form input
Server Request representation with json or form input body

```php
use Seeren\Http\Request\Request;
Expand All @@ -126,9 +105,11 @@ $request = new Request(
);
```

## Seeren\Http\Response\Response
* * *

Client or server response
## Seeren\\Http\\Response\\Response

Server response

```php
use Seeren\Http\Response\Response;
Expand All @@ -139,6 +120,8 @@ $response = new Response(
);
```

* * *

## License

This project is licensed under the MIT License
This project is licensed under the [MIT](./LICENSE) License

0 comments on commit 9c79a5a

Please sign in to comment.