OpenERP use REST Web services to handle all type of request

The web services is simple i.e. without any access right involed, its advisable to keep access right to make webservices safe from outside or third party. To make web service in OpenERP below code is used:

CODE:
from werkzeug.wrappers import Request, Response
from web import http
openerpweb = http

class web_paypal(openerpweb.Controller):
_cp_path = “/web/paypal_return”

@openerpweb.httprequest
def index(self, req, data=None, **kwargs):
# REST OF THE CODE TO HANDLE THESE WEB SERVICE
return werkzeug.wrappers.Response(kwargs, headers=headers)

In above example we have used http request type (@openerpweb.httprequest), there is another way to handle the request (@openerpweb.jsonrequest)
To make request to our OpenERP REST webservices by third party use below URL:
http://IP_ADDRESS:PORT/web/paypal_return

You must be logged in to post a comment.