From 24352ae45b4273fbcad978e05e2aa05e7d2eb1f8 Mon Sep 17 00:00:00 2001 From: vlw Date: Wed, 20 Nov 2024 10:38:06 +0000 Subject: [PATCH] doc(fix): use a POST request as the example in the README instread of GET (#14) The example sends a request body to a GET request, and [GET requests can not have a request body](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET). So this PR changes the example to a POST request instead. Reviewed-on: https://codeberg.org/reflect/reflect-rules-plugin/pulls/14 Co-authored-by: vlw Co-committed-by: vlw --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 70d30f0..2d68022 100644 --- a/README.md +++ b/README.md @@ -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() {