Bottle Py: Enabling CORS for jQuery AJAX requests

前端 未结 4 1943
鱼传尺愫
鱼传尺愫 2020-11-28 08:40

I\'m working on a RESTful API of a web service on the Bottle Web Framework and want to access the resources with jQuery AJAX calls.

Using a REST client, the resource

4条回答
  •  孤独总比滥情好
    2020-11-28 09:27

    Also shouldn't you actually be using this?

    response.set_header('Access-Control-Allow-Origin', '*')
    response.add_header('Access-Control-Allow-Methods', 'GET, POST, PUT, OPTIONS')
    

提交回复
热议问题