Skip to content

Commit 788bf78

Browse files
committed
Update README.md
1 parent dbcb66b commit 788bf78

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

README.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# Leetcode-Api
22

3-
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/NeserCode/Leetcode-Api"> <img title="GitHub download" src="https://img.shields.io/github/downloads/NeserCode/Leetcode-Api/total"/>
3+
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/NeserCode/Leetcode-Api"> <img title="GitHub download" src="https://img.shields.io/github/downloads/NeserCode/Leetcode-Api/total"/>
44

55

66

77
关于 力扣 的网络请求接口。
88
HttpRequest api for leetcode(zh-cn).
99

10-
- [Leetcode-Api](#Leetcode-Api)
11-
* [免责声明](#免责声明)
12-
* [项目总览](#项目总览)
13-
* [接口详情](#接口详情)
10+
## 目录
11+
12+
* [免责声明](#免责声明)
13+
* [项目总览](#项目总览)
14+
* [接口详情](#接口详情)
1415

1516
## 免责声明
1617

@@ -39,4 +40,24 @@ Then use the function in Leetcode-API through the variable in the above example.
3940

4041
## 接口详情
4142

42-
力扣 官网使用了 **GraphQL** 技术来获取数据
43+
力扣 官网使用了 [**GraphQL**](https://graphql.org/) 技术来获取数据,即 **按需分配数据** 的模式。同时,全部网络请求需要附着 Cookie 访问,部分网络请求需要确认 **Referer** 是否属于力扣域名之下。请使用这些 WebApi 之前制定好相关解决方案。
44+
Leetcode uses [**GraphQL**](https://graphql.org/) technology to obtain data, that is, the mode of **on-demand data distribution**. At the same time, all network requests need to be attached with Cookie access, and some network requests need to confirm whether the **Referer** belongs to Leetcode domain name. Develop a solution before using these WebApis.
45+
46+
### 部分解决方案
47+
48+
在传统的 HTML5 项目中,如:
49+
In traditional HTML5 projects, such as:
50+
51+
```html
52+
|-images
53+
|--images01.jpg
54+
|-js
55+
|--example.js
56+
|-style
57+
|--style.css
58+
|-index.html
59+
```
60+
61+
这种项目中,由于伪造 Referer 带来的不安全和危险,一般不会允许用户通过 Javascript 脚本去修改 HttpRequest 的表头中的几项,也就是 RequestHeader 中的几项,其中就包含有 Referer 项。
62+
In such projects, due to the safety and risk of forgery of the Referer, it is generally not allowed to modify the items in the HttpRequest header, i.e. the items in the RequestHeader, which contain the Referer item.
63+

0 commit comments

Comments
 (0)