Hi all,
I am trying to get an xmlrpc server setup in python, but my server doesnt like the request from the robot. My server reports:
code 400, message Bad request version ('encoding="UTF-8"?>')
the robot shows this error…but i think the robot side error is because the server has simply not provided a response:
any ideas?
I tried adding encoding='UTF-8'
to the server declaration, but i get the same error on the server
python code:
with SimpleXMLRPCServer((‘192.168.2.1’, 45330),
requestHandler=RequestHandler,allow_none=True,encoding=“UTF-8”) as server:
server.RequestHandlerClass.protocol_version=“HTTP/1.1”
server.register_introspection_functions()
@server.register_function
…
[functions in here]
…
serverLog.info(f’starting server…')
server.serve_forever()
Found it! For anyone else that stumbles across this in the future:
I had specified :int
in my xmlrpc server function registration, but i was passing in a string.
my funciton looked like this:
def function(n:int):
but I was passing in a string.
changed function to:
def function(n:str)
and it works great