How to check the buzz request payload

Guzzle includes a simple NodeJS server for testing, and I use this to mock my backend. The server contains the getReceivedRequests method, which returns a list of all requests it receives, and I'm trying to check the requests to make sure my program sends them correctly.

GET is simple enough. Looking at the Request class, I can get the request parameters and approve them.

The question arises when I try to check the PUT request. Looking at the Request class, it seems to me that there is no way to get its payload. In fact, I don’t even know where the payload is stored in the object, since there are no private fields designated as such.

Anyway, can I claim a buzz request payload?

+6
source share
1 answer

I use this to check and debug my request payload

$request->getBody()->read($request->getBody()->getSize())

0
source

Source: https://habr.com/ru/post/983988/


All Articles