0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-15 10:13:53 +01:00

Use encode_canonical_json for http client

This commit is contained in:
Erik Johnston 2015-02-11 17:34:23 +00:00
parent e9e54449f5
commit 2bf0e85f3d

View file

@ -15,6 +15,8 @@
from synapse.http.agent_name import AGENT_NAME from synapse.http.agent_name import AGENT_NAME
from syutil.jsonutil import encode_canonical_json
from twisted.internet import defer, reactor from twisted.internet import defer, reactor
from twisted.web.client import ( from twisted.web.client import (
Agent, readBody, FileBodyProducer, PartialDownloadError Agent, readBody, FileBodyProducer, PartialDownloadError
@ -64,7 +66,7 @@ class SimpleHttpClient(object):
@defer.inlineCallbacks @defer.inlineCallbacks
def post_json_get_json(self, uri, post_json): 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) logger.info("HTTP POST %s -> %s", json_str, uri)