Esempio n. 1
0
    def render_POST(self, request):
        """ Process a POST and return a response. This will handle
		all the AJAX read and write requests for data.
		"""

        # Update the server rate counter stats for reporting.
        HMIData.ERPStatus.IncRequestCounter()

        # Get the JSON data from the content.
        recvjson = request.content.read()

        # No data?
        if len(recvjson) == 0:
            return HMIMsg.ServerErrorMessage()

        # Analyse the request and construct a response.
        # restricted = False, erpfilter = True
        respjson = HMIData._HandleMessage(recvjson, False, True)

        # Return the JSON response.
        return respjson
Esempio n. 2
0
    def render_POST(self, request):
        """ Process a POST and return a response. This will handle
		all the AJAX read and write requests for data.
		"""

        # Update the server rate counter stats for reporting.
        HMIData.RHMIStatus.IncRequestCounter()

        # Get the JSON data from the message.
        try:
            recvjson = request.received_headers['cascadas']
        except:
            # The data wasn't found in the headers.
            return HMIMsg.ServerErrorMessage()

        # Analyse the request and construct a response.
        # restricted = True, erpfilter = False
        respjson = HMIData._HandleMessage(recvjson, True, False)

        # Return the JSON response.
        return respjson
	def render_POST(self, request):
		""" Process a POST and return a response. This will handle
		all the AJAX read and write requests for data.
		"""

		# Update the server rate counter stats for reporting.
		HMIData.ERPStatus.IncRequestCounter()

		# Get the JSON data from the content.
		recvjson = request.content.read()

		# No data?
		if len(recvjson) == 0:
			return HMIMsg.ServerErrorMessage()


		# Analyse the request and construct a response.
		# restricted = False, erpfilter = True
		respjson = HMIData._HandleMessage(recvjson, False, True)

		# Return the JSON response.
		return respjson
	def render_POST(self, request):
		""" Process a POST and return a response. This will handle
		all the AJAX read and write requests for data.
		"""

		# Update the server rate counter stats for reporting.
		HMIData.RHMIStatus.IncRequestCounter()

		# Get the JSON data from the message.
		try:
			recvjson = request.received_headers['cascadas']
		except:
			# The data wasn't found in the headers.
			return HMIMsg.ServerErrorMessage()


		# Analyse the request and construct a response.
		# restricted = True, erpfilter = False
		respjson = HMIData._HandleMessage(recvjson, True, False)

		# Return the JSON response.
		return respjson