Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the differences between ajax request and normal request

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail what are the differences between ajax request and normal request. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

The header (Header) of an ajax request (asynchronized) is different from that of a normal request (synchronized):

String reqType = request.getHeader ("X-Requested-With"); if (null = = reqType) {/ / normal request} else if (reqType.equals ("XMLHttpRequest")) {/ / ajax request}

1 、 request headers

Accept:text/html,application/xhtml+xml,application/xml;q=0.9,p_w_picpath/webp,*/*;q=0.8

Accept-Encoding:gzip, deflate, sdch

Accept-Language:zh-CN,zh;q=0.8,en;q=0.6

Connection:keep-alive

Cookie:BD_HOME=0; BD_UPN=12314353; BAIDUID=6D80EC15FB3F7D55F6CF21531B4789A2:FG=1

Host:www.baidu.com

Referer: http://news.baidu.com/

Upgrade-Insecure-Requests:1

User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36

Response headers

BDPAGETYPE:1

BDQID:0xcc5e27ca0001088a

BDUSERID:0

Cache-Control:private

Connection:keep-alive

Content-Encoding:gzip

Content-Type:text/html; charset=utf-8

Cxy_all:baidu+1e0afc7905a9c9dcea7d6f252627f95b

Date:Fri, 06 May 2016 06:35:43 GMT

Expires:Fri, 06 May 2016 06:35:22 GMT

Server:bfe/1.0.8.14

Set-Cookie:PSTM=1462516543; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com

Set-Cookie:__bsi=17208040824016918998_00_2870_R_N_6_0303_C02F_N_I_I_0; expires=Fri, 06-May-16 06:35:48 GMT; domain=www.baidu.com; path=/

Set-Cookie:H_PS_PSSID=1442_19713_18281_19805_19899_19559_19807_19843_19902_19861_17001_15263_12288; path=/; domain=.baidu.com

Set-Cookie:BIDUPSID=6D80EC15FB3F7D55F6CF21531B4789A2; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com

Set-Cookie:BD_HOME=0; path=/

Set-Cookie:BDSVRTM=0; path=/

Transfer-Encoding:chunked

Vary:Accept-Encoding

X-Powered-By:HPHP

Xmuri UAMI compatible with IEEE colors EdgePhrine chrometries 1

2. Ajax Asynchronous request headers

Accept:text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, * / *; qroom0.01

Accept-Encoding:gzip, deflate, sdch

Accept-Language:zh-CN,zh;q=0.8,en;q=0.6

Connection:keep-alive

Cookie:BAIDUID=6D80EC15FB3F7D55F6CF21531B4789A2:FG=1; PSTM=1462516543; BD_HOME=0; Houses PSSS IDs 1442, 1913, 18281, 19805, 19899, 19559, 19807, 19843, 19902, 19861, 17001, 15263, 12288; _ _ bsi=17208040824016918998_00_2870_R_N_6_0303_C02F_N_I_I_0; BIDUPSID=5081A970DD87C74CFFBADF0B28A1AF39; BD_UPN=12314353

Host:www.baidu.com

Referer: https://www.baidu.com/

User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36

X-Requested-With:XMLHttpRequest

Ajax Asynchronous response headers

Cache-Control:private

Connection:keep-alive

Content-Length:95

Content-Type:baiduApp/json; v6.27.2.14; charset=UTF-8

Date:Fri, 06 May 2016 06:35:45 GMT

Expires:Fri, 06 May 2016 07:35:45 GMT

Server:bfe/1.0.8.14

Set-Cookie:__bsi=16943568347195085118_00_0_I_R_1_0303_C02F_N_I_I_0; expires=Fri, 06-May-16 06:35:50 GMT; domain=www.baidu.com; path=/

This is the end of the article on "what are the differences between ajax request and normal request". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report