'Handle HTTP REPLICATE request.
Handler for RPC calls for account replication.'

@public
@replication
@timing_stats()
def REPLICATE(self, req):

    post_args = split_and_validate_path(req, 3)
    (drive, partition, hash) = post_args
    if (self.mount_check and (not check_mount(self.root, drive))):
        return HTTPInsufficientStorage(drive=drive, request=req)
    try:
        args = json.load(req.environ['wsgi.input'])
    except ValueError as err:
        return HTTPBadRequest(body=str(err), content_type='text/plain')
    ret = self.replicator_rpc.dispatch(post_args, args)
    ret.request = req
    return ret
