理解http request headers中Referer||User-Agent||Cookie...的意义

  • 缘起

    Python写爬虫,对于AJAX内容,需要在request.get(url, headers)中传入headers,需要了解headers中各项的意义。

  • Request header 请求头

    HTTP header fields are components of the header section of request and response messages in the Hypertext Transfer Protocol (HTTP). They define the operating parameters of an HTTP transaction.

    Standard request fields and Standard response fields

    Referer : This is the address of the previous web page from which a link to the currently requested page was followed.

    User-Agent : The user agent string of the user agent. It is the fields which User agent identification is transmitted. When a software agent operates in a network protocol, it often identifies itself, its application type, operating system, software vendor, or software revision, by submitting a characteristic identification string to its operating peer.

    Cookie : An HTTP cookie previously sent by the server with Set-Cookies.

  • HTTP cookie

    An HTTP cookie(also called web cookie, Internet cookie, brower cookie, or simply cookie) is a small piece of data stored on the user’s computer by the web browser while browsing a website.

    Cookies were designed to be a reliable mechanism for websites to remember stateful information (such as items added in the shopping cart in an online store) or to record the user’s browsing activity(including clicking particular buttons, logging in, or recording which pages were visited in the past). They can also be used to remember pieces of information that user previously entered into form fields, such as names, addresses, passwords, and payment card numbers.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值