关于jsonp使用post请求

今天看到一段代码jsonp请求使用了post,很困惑,看了一点资料,首先jsonp的请求方式在后台方面不能规定用post请求,这样会报错,在没有规定的情况下
If you specify dataType: “jsonp” and type “POST”, the “jsonp” takes precedent and it gets sent as a “GET” request (the “POST” gets ignored). Benefit is that this preserves the jsonp functionality, down-side is that it silently fails to POST and GETs instead (so you have to really be paying attention to catch it…)

翻译大意过来就是:如果你明确规定用“post”,jsonp就会采取先前的惯例用get作为发送方式,post就会被忽略.这样的好处就是可以jsonp的功能性,另一方面,它默默地将post失败的请求用get代替

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值