Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dim-s authored Apr 25, 2018
1 parent 32098f1 commit f9d3690
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions exts/jphp-httpserver-ext/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ Check it, open [http://localhost:8888/hello/YourName](http://localhost:8888/hell

---

3
. **Show client data**.
3. **Show client data**.
```php
use php\http\{HttpServer, HttpServerRequest, HttpServerResponse};

Expand Down Expand Up @@ -85,7 +84,7 @@ Check it, open [http://localhost:8888/client-data](http://localhost:8888/hello-w

---

1. **Run server with hello world page**.
4. **Query parameters**.
```php
use php\http\{HttpServer, HttpServerRequest, HttpServerResponse};

Expand All @@ -94,8 +93,6 @@ $server = new HttpServer(8888, '127.0.0.1'); // port & host.

// add route with method + path + handler.
$server->route('GET', '/demo-get', function (HttpServerRequest $req, HttpServerResponse $res) {
$res->contentType('text/html');
$text = $req->attribute('text');
$res->contentType('text/html');
$name=$req->queryParameters()['name']; //get GET parameter "name"
$res->body("You name: $name"); //Show get parameter "name"
Expand Down

0 comments on commit f9d3690

Please sign in to comment.