I am trying to simulate a protocol error 504 gateway timeout. This is my server code. I would like to return a 504 error in the add() method.
from SimpleXMLRPCServer import SimpleXMLRPCServer
def add(x,y):
return x+y
# A simple server with simple arithmetic functions
server = SimpleXMLRPCServer(("localhost", 8000))
print "Listening on port 8000..."
server.register_multicall_functions()
server.register_function(add, 'add')
server.serve_forever()
Thank you in advance for your time.
Here is how you can simulate a 504 error with Flask:
If you try
http://127.0.0.1:8000/
with your browser, you'll get:With the exit status = 504.
Of course, if you want a different message (text instead of HTML), you can try: