[Profiler] No captured body (Symfony Client)
KDederichs opened this issue · 4 comments
PHP version: 8.1.9
Description
I'm trying to communicate with an API that returns XML responses and I'm noticing that the Profiler doesn't contain the response or the request body (even though it's there).
How to reproduce
I have my client configured this way:
client_name:
factory: 'httplug.factory.symfony'
http_methods_client: true
plugins:
- 'httplug.plugin.content_length'
- 'httplug.plugin.redirect'
- add_host:
host: 'https://endpoint.com'
- header_defaults:
headers:
"Content-Type": 'application/xml'
"Accept": 'application/xml'
But I noticed it also seems to happen if you just do http_methods_client: true without any other config.
Possible Solution
No Clue something's not capturing the response right I'd wager.
Additional context
Here's a screentshot with an example request to a search engine:

Symfony version is 6.1.3
Ok update, turns out it's because the captured_body_length is 0 by default.
I'd suggest to either increase that or make a hint next to the (This message has no captured body) string.
Something like (This message has no captured body, this is either due to no available content or because the captured_body_length is set to 0)
Technically this would be tricky thing to do. PR welcome though.
thank you @KDederichs for bringing up the suggestion. i was aware of the reason why you get "no captured body" but its much better if the message is self-explanatory.
👍
Thanks for adding it so quickly!