課程
/后端開發
/PHP
/Restful API實戰
老師使用的是dchp工具對http 方法做限定的,那么正式項目中前端是怎么設置put這個方法的呢?這種情況沒遇見過呃,求指教……^_^
2017-08-20
源自:Restful API實戰 4-1
正在回答
DELETE:
$.ajax({ ? ?url: '/script.cgi', ? ?type: 'DELETE', ? ?success: function(result) { ? ? ? ?// Do something with the result ? ?}});
PUT:
$.ajax({ ? url: 'script.php', ? type: 'PUT', ? success: function( response ) { ? }});
逝水闌珊夜 提問者
舉報
PHP后端開發者如何迎上移動互聯網發展熱潮?
1 回答為什么 Restful 類的方法與 User 類、Article 類的方法中存在大量重復的異常處理?
3 回答請問一下create方法報錯這是怎么回事
2 回答請問nginx rewrite 應該怎么寫呢?
1 回答快捷鍵: 選中方法名 然后右鍵 -> add method 這個我怎么沒有
1 回答請問老師和同學這個restful的logout是怎么處理的?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-09-06
DELETE:
$.ajax({
? ?url: '/script.cgi',
? ?type: 'DELETE',
? ?success: function(result) {
? ? ? ?// Do something with the result
? ?}});
PUT:
$.ajax({
? url: 'script.php',
? type: 'PUT',
? success: function( response ) {
? }});