HttpFileGeneratorPlugin
從攔截的要求和回應產生 HTTP 檔案。
外掛程式實例定義
{
"name": "HttpFileGeneratorPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
"configSection": "httpFileGeneratorPlugin"
}
設定範例
{
"httpFileGeneratorPlugin": {
"includeOptionsRequests": false
}
}
設定屬性
屬性 | 說明 | 預設 |
---|---|---|
includeOptionsRequests |
判斷是否要在 OPTIONS 產生的 HTTP 檔案中包含要求 |
false |
命令列選項
None
備註
當外掛程式產生 HTTP 檔案時,它會從要求標頭和查詢字串參數擷取授權資訊,例如持有人令牌和 API 密鑰。 它會以佔位元取代實際值,並將它們儲存在變數中,以方便管理。
例如,針對下列要求:
GET https://jsonplaceholder.typicode.com/posts?api-key=123
外掛程式會產生下列 HTTP 檔案:
@jsonplaceholder_typicode_com_api_key = api-key
###
# @name getPosts
GET https://jsonplaceholder.typicode.com/posts?api-key={{jsonplaceholder_typicode_com_api_key}}
Host: jsonplaceholder.typicode.com
User-Agent: curl/8.6.0
Accept: */*
Via: 1.1 dev-proxy/0.19.0
外掛程式會為每個主機名和要求標頭/查詢字串參數組合建立變數。 如果多個要求使用相同的組合,外掛程式會重複使用 變數。