| 1 | import logging |
|---|
| 2 | logging.basicConfig(level=logging.DEBUG, |
|---|
| 3 | format='%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s') |
|---|
| 4 | |
|---|
| 5 | from pyamf.remoting.client import RemotingService |
|---|
| 6 | |
|---|
| 7 | appName = 'MyApp/0.1.0' |
|---|
| 8 | |
|---|
| 9 | client = RemotingService('http://demo.pyamf.org/gateway/helloworld') |
|---|
| 10 | service = client.getService('echo') |
|---|
| 11 | |
|---|
| 12 | print 'with default user-agent:', service.echo('Hello World!') |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | client = RemotingService('http://demo.pyamf.org/gateway/helloworld', |
|---|
| 16 | user_agent=appName) |
|---|
| 17 | service = client.getService('echo') |
|---|
| 18 | |
|---|
| 19 | print 'with custom user-agent:', service.echo('Hello World!') |
|---|