简单请求和非简单请求

120 阅读1分钟

可以发起简单请求的methods 只有get、head、post 三个,而且条件很严格

HTTP的头信息不超出以下几种字段:

  • Accept

  • Accept-Language

  • Content-Language

  • Last-Event-ID

  • Content-Type:只限于三个值application/x-www-form-urlencodedmultipart/form-datatext/plain

    非简单请求 也包括(get、head、post)、put delete,

    非简单请求如果跨域的情况需要,浏览器发起options 预检请求,如果服务器有回应才会发起真正的请求