-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
83 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import requests | ||
|
||
# 服务工作者的 URL | ||
worker_url = 'https://agent.xz39.xyz/' # 请根据实际情况修改 | ||
|
||
# 要转发的请求信息 | ||
payload = { | ||
'url': 'https://httpbin.org/post', # 目标 URL | ||
'method': 'POST', | ||
'headers': { | ||
'Content-Type': 'application/json', | ||
'Custom-Header': 'CustomValue' | ||
}, | ||
'body': { | ||
'key': 'value' | ||
} | ||
} | ||
|
||
# 发送 POST 请求到服务工作者 | ||
response = requests.post(worker_url, json=payload) | ||
|
||
# 输出响应信息 | ||
print('Status Code:', response.status_code) | ||
print('Response Headers:', response.headers) | ||
print('Response Body:', response.text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters