Template Metadata
- id → Unique identifier of the template.
- info → Metadata including name, author, tags, category, and description.
- enabled → Indicates if the template is active.
- tags → Keywords for filtering and organizing templates.
Summary
This template shows how Flowtamper can:- Intercept API requests based on host, path, method, and headers.
- Modify both request and response headers.
- Replace content in request or response bodies.
- Extract specific data using regex-based extractors.
Match Rules
Defines which requests Flowtamper will intercept and process. You can filter by host, path, HTTP method, and header patterns.- host_regex → Match any host (.*).
- method → Only intercept GET requests.
- path_regex → Matches requests to /.
- headers_matchers → Only requests with a User-Agent header are intercepted.
Actions
Defines what modifications Flowtamper will perform on intercepted requests and responses.Request Modifications
Describes the changes applied to outgoing client requests before they reach the server.- add_headers → Injects a custom header X-Custom-Header.
- remove_headers → Removes caching headers to force fresh responses.
- replace_body → Replaces occurrences of foo with bar in the request body.
Response Modifications
Describes the changes applied to incoming server responses before they reach the client.- status → Apply modifications only to responses with status 200.
- add_headers → Inject a custom response header.
- remove_headers → Remove caching headers.
- replace_body → Inject an HTML h1 tag inside the body element of the response.
Extractors
Defines rules to extract specific data from intercepted requests or responses.- type → Defines the extraction method (regex).
- name → Variable name to store extracted value.
- part → Part of the message to extract from (body).
- group → Regex capture group.
- regex → Regular expression used to capture specific data.
- csrf_token extracts a hidden input token from the HTML body.
- title extracts the content of the title tag.