diff options
-rw-r--r-- | lib/SparkPost/SparkPost.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/SparkPost/SparkPost.php b/lib/SparkPost/SparkPost.php index d4e9421..0d3c6b5 100644 --- a/lib/SparkPost/SparkPost.php +++ b/lib/SparkPost/SparkPost.php @@ -147,7 +147,13 @@ class SparkPost $url = $this->getUrl($uri, $params); $headers = $this->getHttpHeaders($headers); - return $this->getMessageFactory()->createRequest($method, $url, $headers, json_encode($body)); + // Sparkpost API will not tolerate form feed in JSON. + $jsonReplace = [ + '\f' => '', + ]; + $body = strtr(json_encode($body), $jsonReplace); + + return $this->getMessageFactory()->createRequest($method, $url, $headers, $body); } /** |