summary refs log tree commit diff
path: root/synapse/http/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/http/client.py')
-rw-r--r--synapse/http/client.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/http/client.py b/synapse/http/client.py
index 7b23116556..e46e7db146 100644
--- a/synapse/http/client.py
+++ b/synapse/http/client.py
@@ -15,6 +15,8 @@
 
 from synapse.api.errors import CodeMessageException
 from synapse.http.agent_name import AGENT_NAME
+from syutil.jsonutil import encode_canonical_json
+
 from twisted.internet import defer, reactor
 from twisted.web.client import (
     Agent, readBody, FileBodyProducer, PartialDownloadError
@@ -23,7 +25,7 @@ from twisted.web.http_headers import Headers
 
 from StringIO import StringIO
 
-import json
+import simplejson as json
 import logging
 import urllib
 
@@ -64,7 +66,7 @@ class SimpleHttpClient(object):
 
     @defer.inlineCallbacks
     def post_json_get_json(self, uri, post_json):
-        json_str = json.dumps(post_json)
+        json_str = encode_canonical_json(post_json)
 
         logger.info("HTTP POST %s -> %s", json_str, uri)