Using PUT/POST/DELETE with JSONP and jQuery

后端 未结 4 2101
长情又很酷
长情又很酷 2020-11-28 01:54

I am working on creating a RESTful API that supports cross-domain requests, JSON/JSONP support, and the main HTTP method (PUT/GET/POST/DELETE). Now while will be easy to ac

4条回答
  •  没有蜡笔的小新
    2020-11-28 02:52

    • Rather than banging our heads with JSONP method, that actually won't support POST method by default, we can go for CORS .That will provide no big changes in the conventional way of programming. By simple Jquery Ajax call we can go with cross domains.
    • In CORS method, you have to add headers in server side scripting file, or in the server itself(in remote domain), for enabling this access. This is much reliable, since we can prevent/restrict the domains making unwanted calls.
    • It can be found in detail in wikipedia page.

提交回复
热议问题