mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
🎨 Add kernel API /api/network/forwardProxy
https://github.com/siyuan-note/siyuan/issues/8724
This commit is contained in:
parent
c78cbe067d
commit
5d7c6d47bf
3 changed files with 106 additions and 9 deletions
48
API.md
48
API.md
|
@ -52,6 +52,8 @@
|
|||
* [Notification](#Notification)
|
||||
* [Push message](#Push-message)
|
||||
* [Push error message](#Push-error-message)
|
||||
* [Network](#Network)
|
||||
* [Forward proxy](#Forward-proxy)
|
||||
* [System](#System)
|
||||
* [Get boot progress](#Get-boot-progress)
|
||||
* [Get system version](#Get-system-version)
|
||||
|
@ -1207,6 +1209,52 @@ View API token in <kbd>Settings - About</kbd>, request header: `Authorization: T
|
|||
```
|
||||
* `id`: Message ID
|
||||
|
||||
## Network
|
||||
|
||||
### Forward proxy
|
||||
|
||||
* `/api/network/forkProxy`
|
||||
* Parameters
|
||||
|
||||
```json
|
||||
{
|
||||
"url": "https://b3log.org/siyuan/",
|
||||
"method": "GET",
|
||||
"timeout": 7000,
|
||||
"contentType": "text/html",
|
||||
"headers": [
|
||||
{
|
||||
"Cookie": ""
|
||||
}
|
||||
],
|
||||
"payload": {}
|
||||
}
|
||||
```
|
||||
|
||||
* `url`: URL to forward
|
||||
* `method`: HTTP method, default is `POST`
|
||||
* `timeout`: timeout in milliseconds, default is `7000`
|
||||
* `contentType`: Content-Type, default is `application/json`
|
||||
* `headers`: HTTP headers
|
||||
* `payload`: HTTP payload, object or string
|
||||
* Return value
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "",
|
||||
"data": {
|
||||
"body": "",
|
||||
"contentType": "text/html",
|
||||
"elapsed": 1976,
|
||||
"headers": {
|
||||
},
|
||||
"status": 200,
|
||||
"url": "https://b3log.org/siyuan"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## System
|
||||
|
||||
### Get boot progress
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue