mirror of
https://codeberg.org/reflect/reflect-rules-plugin.git
synced 2025-09-14 00:43:42 +02:00
doc(fix): example in README use POST request instead of GET
This commit is contained in:
parent
9c837fd194
commit
febbe0f546
1 changed files with 3 additions and 3 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Reference in a new issue