หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Fails requests made to Microsoft Graph with random errors.
Configuration example
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/rc.schema.json",
"plugins": [
{
"name": "GraphRandomErrorPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
"configSection": "graphRandomErrorPlugin"
}
],
"graphRandomErrorPlugin": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/graphrandomerrorplugin.schema.json",
"allowedErrors": [ 429, 500, 502, 503, 504, 507 ]
}
}
Configuration properties
| Property | Description | Default |
|---|---|---|
allowedErrors |
List of HTTP status codes that Dev Proxy might produce. | 429 500 502 503 504 507 |
rate |
The percentage of requests to fail with a random error. Value between 0 and 100. | 50 |
retryAfterInSeconds |
Value of the Retry-After header in seconds. |
5 |
Command line options
| Name | Description | Default |
|---|---|---|
-a, --allowed-errors |
List of HTTP status codes that Dev Proxy might produce. | 429 500 502 503 504 507 |
-f, --failure-rate <failure rate> |
The percentage of requests to fail with a random error. Value between 0 and 100. | 50 |
HTTP error status codes used by Microsoft Graph
Microsoft Graph uses the following HTTP status codes.
Tip
Descriptions from HTTP response status codes
| Code | Name | Description |
|---|---|---|
| 429 | Too Many Requests | Indicates the user has sent too many requests in a given amount of time ("rate limiting"). A Retry-After header might be included to this response indicating how long to wait before making a new request. |
| 500 | Internal Server Error | Indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. This error response is a generic "catch-all" response. Usually, this indicates the server can't find a better 5xx error code to response. |
| 502 | Bad Gateway | Indicates that the server, while acting as a gateway or proxy, received an invalid response from the upstream server. |
| 503 | Service Unavailable | Indicates that the server isn't ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. This response should be used for temporary conditions and the Retry-After HTTP header should, if possible, contain the estimated time for the recovery of the service. |
| 504 | Gateway Timeout | Indicates that the server, while acting as a gateway or proxy, didn't get a response in time from the upstream server that it needed in order to complete the request. |
| 507 | Insufficient Storage | Might be given in the context of the Web Distributed Authoring and Versioning (WebDAV) protocol (see RFC 4918). It indicates that a method couldn't be performed because the server can't store the representation needed to successfully complete the request. |
Next step
ทํางานร่วมกับเราใน GitHub
แหล่งที่มาสำหรับเนื้อหานี้สามารถพบได้บน GitHub ซึ่งคุณยังสามารถสร้างและตรวจสอบปัญหาและคำขอดึงข้อมูลได้ สำหรับข้อมูลเพิ่มเติม ให้ดูคู่มือผู้สนับสนุนของเรา
Dev Proxy