def maybe_save(resource_id, path,
               code=None, location=None,
               resource=None, error=None):
    resource = resource_structure(code, resource_id, location, resource, error)

    if path is not None and resource_id is not None:
        try:
            resource_json = json.dumps(resource)
        except ValueError:
            print "The resource has an invalid JSON format"
        try:
            resource_file_name = "%s%s%s" % (path, os.sep,
                                             resource_id.replace('/', '_'))
            with open(resource_file_name, "wb", 0) as resource_file:
                resource_file.write(resource_json.encode('UTF-8'))
        except IOError:
            print "Failed writing resource to %s" % resource_file_name
    return resource
The request body length as an integer. The client is responsible to
dataset/ETHPy150Open bigmlcom/python/bigml/util.py/maybe_save--crossover with--dataset/ETHPy150Open Arelle/Arelle/arelle/webserver/bottle.py/BaseRequest.content_length