某些Http Proxy或者Http Server不支持Patch操作,这时我们就可以使用Http Post操作来模拟Http Patch操作,仅仅需要在Http Header中添加 X-HTTP-Method-Override Header来指定目标Http Method即可, 例如:

使用jQuery通过Post模拟Patch接口:

$.ajax({
  headers: {
    'X-HTTP-Method-Override': 'Patch'
  },
  method: 'Post'
  // more parameters...
});

参考链接

【腾讯云】境外1核2G服务器低至2折,半价续费券限量免费领取!
https://cloud.tencent.com/act/cps/redirect?redirect=1068&cps_key=e4b50f6c64a4480367f8a8d16fd07c5a&from=console

标签: http, patch, post, header, ajax

添加新评论