diff --git a/src/Context/WebApiContext.php b/src/Context/WebApiContext.php index fa008df..e940ea5 100644 --- a/src/Context/WebApiContext.php +++ b/src/Context/WebApiContext.php @@ -304,6 +304,18 @@ public function printResponse() ); } + /** + * Returns the response as a string. + * + * @return string + */ + public function getResponseAsString() + { + if ($this->response) { + return (string) $this->response->getBody(); + } + } + /** * Prepare URL by replacing placeholders and trimming slashes. *