HttpFileGeneratorPlugin

Generates HTTP file from the intercepted requests and responses.

Screenshot of two command prompt windows. One shows Dev Proxy recording API requests. The other shows the generated HTTP file.

Plugin instance definition

{
  "name": "HttpFileGeneratorPlugin",
  "enabled": true,
  "pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
  "configSection": "httpFileGeneratorPlugin"
}

Configuration example

{
  "httpFileGeneratorPlugin": {
    "includeOptionsRequests": false
  }
}

Configuration properties

Property Description Default
includeOptionsRequests Determines whether to include OPTIONS requests in the generated HTTP file false

Command line options

None

Remarks

When the plugin generates the HTTP file, it extracts authorization information such as bearer tokens and API keys from request headers and query string parameters. It replaces the actual values with placeholders and stores them in variables for easier management.

For example, for the following request:

GET https://jsonplaceholder.typicode.com/posts?api-key=123

The plugin generates the following HTTP file:

@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

The plugin creates variables for each combination of hostname and request header/query string parameter. If multiple requests use the same combination, the plugin reuses the variable.