Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
55891dff
Commit
55891dff
authored
Apr 28, 2026
by
陈曦
Browse files
整理capture requests实现和apikey capture的标识位设置sh
parent
aa6d2cf7
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
REQUEST_CAPTURE_CHANGES.md
View file @
55891dff
This diff is collapsed.
Click to expand it.
capture_requests.sh
View file @
55891dff
...
...
@@ -18,7 +18,7 @@ set -euo pipefail
# ---------- 默认配置(可通过环境变量覆盖)----------
DEFAULT_BASE_URL
=
"https://s2a-st.appbym.com"
DEFAULT_ADMIN_KEY
=
"admin-
bccab2aa363738a3f8140f014a8bab2b4e23f4bb8be15c72d1d79299981d38a0
"
DEFAULT_ADMIN_KEY
=
"admin-
0c19f7fca7f05050a946c7ded419693f6aa3893221e82b5718663c198b002ace
"
BASE_URL
=
"
${
BASE_URL
:-
$DEFAULT_BASE_URL
}
"
ADMIN_KEY
=
"
${
ADMIN_KEY
:-
$DEFAULT_ADMIN_KEY
}
"
...
...
@@ -90,13 +90,13 @@ echo ""
HTTP_RESPONSE
=
$(
curl
-s
-w
"
\n
%{http_code}"
\
-X
PUT
"
$ENDPOINT
"
\
-H
"
Authorization: Bearer
$ADMIN_KEY
"
\
-H
"
x-api-key:
$ADMIN_KEY
"
\
-H
"Content-Type: application/json"
\
-d
"{
\"
enabled
\"
:
$ENABLED
}"
)
# 分离响应体和状态码
HTTP_BODY
=
$(
echo
"
$HTTP_RESPONSE
"
|
sed
'$d'
)
HTTP_CODE
=
$(
echo
"
$HTTP_RESPONSE
"
|
tail
-n
1
)
HTTP_BODY
=
$(
echo
"
$HTTP_RESPONSE
"
|
sed
'$d'
|
tr
-d
'\r'
)
HTTP_CODE
=
$(
echo
"
$HTTP_RESPONSE
"
|
tail
-n
1
|
tr
-d
'\r'
)
# ---------- 结果输出 ----------
echo
"HTTP 状态码:
$HTTP_CODE
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment