doc(fix): example in README use POST request instead of GET

This commit is contained in:
Victor Westerlund 2024-11-20 10:03:06 +00:00
parent 9c837fd194
commit febbe0f546

View file

@ -3,9 +3,9 @@ This request pre-processor adds request validation for an API written in the Ref
Write safer Reflect endpoints by enforcing request data structure validation before the request reaches your endpoint's logic. This plugin validates GET and POST data (even JSON) and returns an array with scoped `Error`s that can be further acted upon if desired.
*Example:*
## Example
```
GET Request: /my-endpoint?key1=lorem-ipsum&key2=dolor
POST Request: /my-endpoint?key1=lorem-ipsum&key2=dolor
POST Body: {"key3":15, "key4":["hello", "world"]}
```
```php
@ -16,7 +16,7 @@ use \ReflectRules\Type;
use \ReflectRules\Rules;
use \ReflectRules\Ruleset;
class GET_MyEndpoint implements Endpoint {
class POST_MyEndpoint implements Endpoint {
private Ruleset $rules;
public function __construct() {