diff --git a/stress-testing.md b/stress-testing.md index 4e14dc9..f2d9fa4 100644 --- a/stress-testing.md +++ b/stress-testing.md @@ -53,6 +53,12 @@ The concurrency value represents the number of concurrent requests that will be You may want to be mindful of the number of concurrent requests you configure. If you configure too many concurrent requests, you may overwhelm your application, server or hit rate limits / firewalls. +If you want to specify the http method used for the stress test, you can use the provided `get` and `post` options. Using the `--post` option, you can specify as argument the payload to be used in the requests: + +```bash +./vendor/bin/pest stress example --post='{"name": "Nuno"}' +``` + Once the stress test is completed, Pest will display a summary of the stress test result. @@ -94,6 +100,15 @@ $result = stress('example.com')->dd(); //->verbosely(); ``` +If you want to specify the http method used for the stress test, you can use the provided `get` and `post` methods. + +```php +$result = stress('example.com')->get(); +// or +$result = stress('example.com')->post(['name' => 'Nuno']); +``` + +If you are using the POST http method, remember to pass to the `post` method the payload to be used in the requests. The `stress()` function return the stress test result, which you can use to set expectations. Here is the list of available methods: