0

I found woefully few samples of httplib2 using the following template defined in the httplib2 documents.

The following (GETs) work (and I now need to implement POST methods using it)

URLS = (
    '/',                 'PingLocal',
    '/ping',             'PingLocal',
    '/ping/silo',        'PingSilo'
)
class PingLocal(object):
    def GET(self):
        return json.dumps({'time': time.strftime('%m/%d/%Y %I:%M:%S'), 'message': 'XYZ Server Responding to Ping'})

How to implement POST methods and pass data (body) to the post request? A few examples I did come across do not use this suggested

"URLS-list / Classes" model.

Any pointers appreciated. Thank you.

user3213604
  • 407
  • 1
  • 7
  • 18

1 Answers1

0

I made a mistake. In the code I am implementing the REST Server AND in the implemented methods - I am in turn making REST client calls to remote URIs.

I am using httplib2 to make those REST client calls (as the library documentation clearly mentions - its the client library).

I am in turn using web.py module to implement the REST server - and found the relevant documentation there.

Thank you

user3213604
  • 407
  • 1
  • 7
  • 18