|Get the body of the request||Adrian Moya||3/31/12 9:59 AM|
Hi Michael, is there a way to get the body of a request before sending? I discovered an error in one of my clients I wish to cover with a unit test, so that I can check (as I currently do with the url and the query params) if the body is getting built correctly. Something like:
I currently was able to came up with this:
But I still have to play with lenght to get it right. I plan to implement this test on all my POST commands.
|Re: [guzzle] Get the body of the request||Michael||3/31/12 10:20 AM|
You can read the body as a string by casting the body of the request to string or by calling the __toString method of the request entity body.