Skip to content

Instantly share code, notes, and snippets.

@petermanser
Created May 20, 2014 14:38
Escape "@" in Guzzle body values
<?php
// Fix: cURL/Guzzle body parameters may not start with @, see: https://bugs.php.net/bug.php?id=50060
foreach ($body as $key => $value) {
if (is_string($value) && substr($value, 0, 1) == '@') {
$body[$key] = ' ' . $value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment