def render(self, request):
        
        request.setHeader('Content-type', 'text/javascript; charset=UTF-8')
        
        if len(request.postpath) > 0:
            if request.postpath[0] == "server":
                return simplejson.dumps(self.spider.getServerData())
            elif request.postpath[0] == "exposed_function_details":
                return simplejson.dumps(self.spider.getExposedFunctionDetails())
            elif request.postpath[0] == "get":
                if "uuid" in request.args:
                    get_deferreds = []
                    for uuid in request.args["uuid"]:
                        get_deferreds.append(self.spider.get(uuid))
                    d = DeferredList(get_deferreds, consumeErrors = True)
                    d.addCallback(self._getCallback, request.args["uuid"])
                    d.addCallback(self._successResponse)
                    d.addErrback(self._errorResponse)
                    d.addCallback(self._immediateResponse, request)
                    return server.NOT_DONE_YET
                else:
                    return self._errorResponse(Failure(exc_value=Exception("Parameter UUID is required.")))
            elif request.postpath[0] == "show_reservation":
                if "uuid" in request.args:
                    d = self.spider.showReservation(request.args["uuid"][0])
                    d.addCallback(self._successResponse)
                    d.addErrback(self._errorResponse)
                    d.addCallback(self._immediateResponse, request)
                    return server.NOT_DONE_YET
                else:
                    return self._errorResponse(Failure(exc_value=Exception("Parameter UUID is required.")))
            elif request.postpath[0] == "delete_reservation":
                if "uuid" in request.args:
                    d = self.spider.deleteReservation(request.args["uuid"][0])
                    d.addCallback(self._successResponse)
                    d.addErrback(self._errorResponse)
                    d.addCallback(self._immediateResponse, request)
                    return server.NOT_DONE_YET
                else:
                    return self._errorResponse(Failure(exc_value=Exception("Parameter UUID is required.")))
            elif request.postpath[0] == "delete_function_reservations": 
                if "function_name" in request.args:
                    d = self.spider.deleteFunctionReservations(request.args["function_name"][0])
                    d.addCallback(self._successResponse)
                    d.addErrback(self._errorResponse)
                    d.addCallback(self._immediateResponse, request)
                    return server.NOT_DONE_YET           
                else:
                    return self._errorResponse(Failure(exc_value=Exception("Parameter function_name is required."))) 
            elif request.postpath[0] == "execute_reservation":
                if "uuid" in request.args:
                    d = self.spider.queryByUUID(request.args["uuid"][0])
                    d.addCallback(self._successResponse)
                    d.addErrback(self._errorResponse)
                    d.addCallback(self._immediateResponse, request)
                    return server.NOT_DONE_YET
                else:
                    return self._errorResponse(Failure(exc_value=Exception("Parameter UUID is required.")))
dataset/ETHPy150Open wehriam/awspider/miscellaneous/old_code/resources/data.py/DataResource.render/original