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.
Allows you to issue web requests using Dev Proxy. This plugin is convenient for simulating requests such as webhook notifications.
To issue the configured request, press w in the command prompt session where Dev Proxy is running.
Plugin instance definition
{
"name": "MockRequestPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
"configSection": "contosoNotification"
}
Configuration example
{
"contosoNotification": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v1.0.0/mockrequestplugin.schema.json",
"mockFile": "mock-request.json"
}
}
Configuration properties
| Property | Description | Default |
|---|---|---|
mockFile |
Path to the file containing the mock request | mock-request.json |
Command line options
None
Mock request file example
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v1.0.0/mockrequestplugin.schema.json",
"request": {
"url": "http://localhost:3000/api/notification",
"method": "POST",
"body": {
"property1": "value1",
"property2": "value2"
}
}
}
Mock request file properties
| Property | Description | Required |
|---|---|---|
request |
Defines the request that Dev Proxy should issue. | Yes |
Mock request properties
| Property | Description | Required | Default |
|---|---|---|---|
url |
URL that Dev Proxy should call. | Yes | empty |
method |
HTTP method that Dev Proxy should use. | No | POST |
body |
Body of the request that Dev Proxy should send. | No | empty |
headers |
Array of request headers that Dev Proxy should send with the request. | No | empty |
You can configure body to a string or a JSON object.
Mock request headers
| Property | Description | Required |
|---|---|---|
name |
Request header name. | Yes |
value |
Request header value. | Yes |
Cộng tác với chúng tôi trên GitHub
Bạn có thể tìm thấy nguồn cho nội dung này trên GitHub, nơi bạn cũng có thể tạo và xem lại các vấn đề và yêu cầu kéo. Để biết thêm thông tin, hãy xem hướng dẫn dành cho người đóng góp của chúng tôi.