Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Dev Proxy allows you to generate an HTTP file from intercepted API requests and responses. Using HTTP files is especially useful for developers who want to simulate API behavior or share reproducible API interactions. The HTTP file includes all relevant request and response details, with sensitive information replaced by variables for security and reusability.
To generate an HTTP file using Dev Proxy:
In the configuration file, enable the
HttpFileGeneratorPlugin:{ "plugins": [ { "name": "HttpFileGeneratorPlugin", "enabled": true, "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll", "configSection": "httpFileGeneratorPlugin" } ] // [...] shortened for brevity }Optionally, configure the plugin:
{ "httpFileGeneratorPlugin": { "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v1.0.0/httpfilegeneratorplugin.schema.json", "includeOptionsRequests": false } // [...] shortened for brevity }includeOptionsRequests: Determines whether to includeOPTIONSrequests in the generated HTTP file. Default isfalse.
In the configuration file, to the list of URLs to watch, add the URL of the API for which you want to generate an HTTP file:
{ "urlsToWatch": [ "https://api.example.com/*" ] // [...] shortened for brevity }Start Dev Proxy:
devproxyStart recording requests by pressing
r.Perform the API requests you want to include in the HTTP file.
Stop recording by pressing
s.Dev Proxy generates an HTTP file and saves it in the current directory. The file includes all captured requests and responses, with sensitive data like bearer tokens and API keys replaced by variables. For example:
@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.29.0The plugin automatically creates variables for each combination of hostname and sensitive parameter, reusing them across requests when applicable.
Next steps
Learn more about the HttpFileGeneratorPlugin.