Server IP : 85.193.89.191 / Your IP : 18.191.165.129 Web Server : Apache System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : bitrix ( 600) PHP Version : 8.1.27 Disable Function : NONE MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/978/cwd/usr/share/doc/python-pycurl-7.19.0/tests/ |
Upload File : |
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # vi:ts=4:et # $Id: test_xmlrpc.py,v 1.7 2003/04/21 18:46:11 mfx Exp $ ## XML-RPC lib included in python2.2 import xmlrpclib import pycurl # Header fields passed in request xmlrpc_header = [ "User-Agent: PycURL XML-RPC Test", "Content-Type: text/xml" ] # XML-RPC request template xmlrpc_template = """ <?xml version='1.0'?><methodCall><methodName>%s</methodName>%s</methodCall> """ # Engage c = pycurl.Curl() c.setopt(c.URL, 'http://betty.userland.com/RPC2') c.setopt(c.POST, 1) c.setopt(c.HTTPHEADER, xmlrpc_header) c.setopt(c.POSTFIELDS, xmlrpc_template % ("examples.getStateName", xmlrpclib.dumps((5,)))) print 'Response from http://betty.userland.com/' c.perform() c.close()