How to Implement Cross-Origin Resource Sharing on CherryPy Platform of Python
Wasun Khan-Am · 2019
Abstract — This article presents how to implement Cross-Origin Resource Sharing, aka CORS, on CherryPy platform of Python. This experiment is under the concept of RESTful. The tools of this experiment are python 3, CherryPy Framework version 18, SQLite 3, USBWebserver version 8.0, JQuery version 1.12, AJAX approach, and use Mozilla Firefox as a web browser. The hardware tool is a laptop computer. Four methods of HTTP methods, namely GET, POST, PUT, and DELETE; based on the concept of RESTful. Those methods were built on CherryPy platform before being tested in the next order. There are three outputs of this experiment that has been shown in this article. Firstly, the RESTful concept has been able to apply by using a Python 3 on CherryPy platform. Secondly, two methods, such as GET and POST, have been able to directly implement under CORS concept with a simple request. Thirdly, the rest method, PUT and DELETE, have been able to apply under CORS concept by using a preflight request.