If `body` Key exists on HTTP Client response, it is removed from the body of the response
I am currently connecting to the Atlassian Confluence Cloud REST API and I'm not sure whether this is a bug or not but....
If I use the native Laravel HTTP client to perform the get request, the body key within the response for each page in Confluence is nowhere to be found when I grab the $response->body() or $response->json() .
It is present when I test the exact same request in Postman and is also present when I use the Guzzle client instead of the HTTP facade within Laravel.
Not sure how useful providing a code example is without someone actually running the request on their own Atlassian account but I wanted to know if anyone else has come across this issue before?
Hi @tray2 yep that's exactly how I usually work.
The issue in this case is that there is a key in the response object called body as it is the 'body' of the confluence article. Using the HTTP client, that particular node seems to get removed from the object entirely.
If I just use Guzzle and $response->getBody()->getContents() then the value of the body key for each confluence article is preserved.