'Puts some json to the given URI.
Args:
uri (str): The URI to request, not including query parameters
json_body (dict): The JSON to put in the HTTP body,
args (dict): A dictionary used to create query strings, defaults to
None.
**Note**: The value of each key is assumed to be an iterable
and *not* a string.
Returns:
Deferred: Succeeds when we get *any* 2xx HTTP response, with the
HTTP body as JSON.
Raises:
On a non-2xx HTTP response.'

@defer.inlineCallbacks
def put_json(self, uri, json_body, args={}):

    if len(args):
        query_bytes = urllib.urlencode(args, True)
        uri = ('%s?%s' % (uri, query_bytes))
    json_str = encode_canonical_json(json_body)
    response = (yield self.request('PUT', uri.encode('ascii'), headers=Headers({'User-Agent': [self.user_agent], 'Content-Type': ['application/json']}), bodyProducer=FileBodyProducer(StringIO(json_str))))
    body = (yield preserve_context_over_fn(readBody, response))
    if (200 <= response.code < 300):
        defer.returnValue(json.loads(body))
    else:
        raise CodeMessageException(response.code, body)
