rename http to httpuri

This commit is contained in:
Dennis Eichhorn 2020-02-12 18:40:17 +01:00
parent 4bb316b355
commit 7079764449

View File

@ -7,7 +7,7 @@ Requests can be either incoming requests such as http requests on the server sid
A http request in its' most basic form only consists of a uri.
```php
$request = new Request(new Http('http://your_request.com/url?to=call'));
$request = new Request(new HttpUri('http://your_request.com/url?to=call'));
```
## Rest Requests
@ -15,21 +15,21 @@ $request = new Request(new Http('http://your_request.com/url?to=call'));
With the rest implementation it's possible to make http requests and read the response.
```php
$request = new Request(new Http('http://your_request.com/url?to=call'));
$request = new Request(new HttpUri('http://your_request.com/url?to=call'));
$result = Rest::request($request);
```
Alternatively it's also possible to make a rest request directly from the Http request object.
```php
$request = new Request(new Http('http://your_request.com/url?to=call'));
$request = new Request(new HttpUri('http://your_request.com/url?to=call'));
$result = $request->rest();
```
The result contains the raw response text. By defining the request method it's also possible to make other requests such as `PUT` requests.
```php
$request = new Request(new Http('http://your_request.com/url?to=call'));
$request = new Request(new HttpUri('http://your_request.com/url?to=call'));
$request->setMethod(RequestMethod::PUT);
$result = Rest::request($request);
```