namshi / cuzzle

This library let's you dump a Guzzle request to a cURL command for debug and log purpose.
https://github.com/namshi/cuzzle
331 stars 68 forks source link

support PUT Guzzle requests #18

Open soundlake opened 8 years ago

soundlake commented 8 years ago

I think it's closely related to the other two issues: #1 and #9.

When I send Guzzle request with PUT method with the binary data, I get the following exception.

FatalErrorException in CurlFormatter.php line 135:
Error: escapeshellarg(): Input string contains NULL bytes

FYI, I leave a part of the stack trace. I don't think you need all of them.

in CurlFormatter.php line 135
at escapeshellarg() in CurlFormatter.php line 135
at CurlFormatter->extractBodyArgument() in CurlFormatter.php line 218
at CurlFormatter->extractArguments() in CurlFormatter.php line 54
at CurlFormatter->format() in GuzzleCollector.php line 99
at GuzzleCollector->collect() in Profiler.php line 223
...

I already saw the pull request #17. But I don't think it's a good idea to show binary data. Instead, I suggest you to put them into a file and give curl argument with -d @[filename] if the file is binary.

nud commented 8 years ago

Actually it could probably just be discarded and replaced with -d @data, at least when used in the context of the Symfony profiler.