Skip to content

Instantly share code, notes, and snippets.

@petermanser
Created May 20, 2014 14:38
Show Gist options
  • Save petermanser/93e8e2956f601586ec21 to your computer and use it in GitHub Desktop.
Save petermanser/93e8e2956f601586ec21 to your computer and use it in GitHub Desktop.
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