# XMLRPC Bad request Encoding

**URL:** <https://forum.universal-robots.com/t/xmlrpc-bad-request-encoding/27385>\
**Category:** Robot Communication\
**Created:** [March 14, 2023, 7:17pm UTC](https://forum.universal-robots.com/t/xmlrpc-bad-request-encoding/27385 "2023-03-14T19:17:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![roguebuck](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/roguebuck/32/4848_2.png) [@roguebuck](https://forum.universal-robots.com/u/roguebuck)\
**Post date:** [March 14, 2023, 7:17pm UTC](https://forum.universal-robots.com/t/xmlrpc-bad-request-encoding/27385/1 "2023-03-14T19:17:45Z")

</div>

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:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/6/618e98bc6342138b429441c778af60df6bd073cd.png)

any ideas?

---

<div class="post-metadata">

**Author:** ![roguebuck](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/roguebuck/32/4848_2.png) [@roguebuck](https://forum.universal-robots.com/u/roguebuck)\
**Post date:** [March 14, 2023, 7:34pm UTC](https://forum.universal-robots.com/t/xmlrpc-bad-request-encoding/27385/3 "2023-03-14T19:34:59Z")

</div>

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()

---

<div class="post-metadata">

**Author:** ![roguebuck](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/roguebuck/32/4848_2.png) [@roguebuck](https://forum.universal-robots.com/u/roguebuck)\
**Post date:** [March 15, 2023, 3:03pm UTC](https://forum.universal-robots.com/t/xmlrpc-bad-request-encoding/27385/4 "2023-03-15T15:03:00Z")

</div>

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
