This article is a mirror article of machine translation, please click here to jump to the original article.

View: 9225|Reply: 0

[JavaScript] Use fetch instead of ajax request post delivery method

[Copy link]
Posted on 6/4/2019 5:01:06 PM | | |
thereintocredentials: 'include'Be sure to set it up.

credentials is a read-only property of the Request interface that indicates whether the user agent should send cookies from other domains in the event of a cross-domain request. This is similar to XHR's withCredentials flag, except that there are three optional values (the latter being two):

  • omit: Never send cookies.
  • same-origin: Only when the URL is homologous to the response script will the authentication information such as cookies and HTTP Basic authentication be sent. (Browser default, in older versions of browsers, e.g. Safari 11 is still omit, Safari 12 has changed)
  • include: Regardless of whether it is a cross-domain request or not, always send authentication information such as cookies and HTTP Basic authentication in the local domain of the requesting resource domain.



Resources:The hyperlink login is visible.




Previous:Front-end Object.assign() usage
Next:Post Discuz requires cookies and formhash
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com