def request_from_cache(file_path):
    # A fake request object is created with necessary attributes
    dummyRequest = DummyObject()
    cache_dict = json.loads(open(file_path, 'r').read())
    dummyRequest.local_timestamp = datetime.datetime.strptime(cache_dict["request_local_timestamp"].strip("\r\n"), '%Y-%m-%dT%H:%M:%S.%f')
    dummyRequest.method = cache_dict["request_method"]
    dummyRequest.url = cache_dict["request_url"]
    dummyRequest.headers = cache_dict["request_headers"]
    dummyRequest.body = cache_dict["request_body"]
    dummyRequest.raw_request = "%s %s %s\r\n" % (cache_dict["request_method"], cache_dict["request_url"], cache_dict["request_version"])
    for name, value in cache_dict["request_headers"].iteritems():
        dummyRequest.raw_request += "%s: %s\r\n" % (name, value)
    if cache_dict["request_body"]:
        dummyRequest.raw_request += cache_dict["request_body"] + "\r\n\r\n"
    return dummyRequest
dataset/ETHPy150Open owtf/owtf/framework/http/proxy/cache_handler.py/request_from_cache/original