如何使用 302 状态代码从响应 Header 中提取值?
How to Extract Value From Response Header with 302 Status Code?
我一直在尝试从响应中提取价值 header。我尝试使用 RegEx 和 Boundary Extractor,但我做不到。该请求总是给出 302 响应代码。
我的回复Header:
HTTP/1.1 302
server: nginx
date: Wed, 23 Feb 2022 12:35:19 GMT
content-length: 0
x-frame-options: SAMEORIGIN
cache-control: no-cache, no-store, max-age=0, must-revalidate
pragma: no-cache
expires: 0
strict-transport-security: max-age=31536000 ; includeSubDomains
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
location: https://somedomainname.com/tr/checkout/orderConfirmation/2202231535500
content-language: tr
connection: close
我要提取的是订单确认号:2202231535500,测试时会作为动态值出现。
使用
orderConfirmation/([0-9]+)
参见regex proof。
解释
--------------------------------------------------------------------------------
orderConfirmation/ 'orderConfirmation/'
--------------------------------------------------------------------------------
( group and capture to :
--------------------------------------------------------------------------------
[0-9]+ any character of: '0' to '9' (1 or more
times (matching the most amount
possible))
--------------------------------------------------------------------------------
) end of
我一直在尝试从响应中提取价值 header。我尝试使用 RegEx 和 Boundary Extractor,但我做不到。该请求总是给出 302 响应代码。
我的回复Header:
HTTP/1.1 302
server: nginx
date: Wed, 23 Feb 2022 12:35:19 GMT
content-length: 0
x-frame-options: SAMEORIGIN
cache-control: no-cache, no-store, max-age=0, must-revalidate
pragma: no-cache
expires: 0
strict-transport-security: max-age=31536000 ; includeSubDomains
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
location: https://somedomainname.com/tr/checkout/orderConfirmation/2202231535500
content-language: tr
connection: close
我要提取的是订单确认号:2202231535500,测试时会作为动态值出现。
使用
orderConfirmation/([0-9]+)
参见regex proof。
解释
--------------------------------------------------------------------------------
orderConfirmation/ 'orderConfirmation/'
--------------------------------------------------------------------------------
( group and capture to :
--------------------------------------------------------------------------------
[0-9]+ any character of: '0' to '9' (1 or more
times (matching the most amount
possible))
--------------------------------------------------------------------------------
) end of