40 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/src/background.js:
--------------------------------------------------------------------------------
1 | import mockjs from 'better-mock';
2 |
3 | const storageCache = {
4 | mockData: [],
5 | enabled: 'Y',
6 | };
7 |
8 | chrome.storage.sync.get((['mockData']), (result) => {
9 | storageCache.mockData = result.mockData || [];
10 | });
11 |
12 | chrome.storage.sync.get((['enabled']), (result) => {
13 | storageCache.enabled = result.enabled || 'Y';
14 | });
15 |
16 | chrome.storage.onChanged.addListener((changes) => {
17 | if (changes.mockData && changes.mockData.newValue) {
18 | storageCache.mockData = changes.mockData.newValue;
19 | }
20 | if (changes.enabled && changes.enabled.newValue) {
21 | storageCache.enabled = changes.enabled.newValue;
22 | }
23 | console.log('Update data:', storageCache);
24 | });
25 |
26 | function getMockData(url, method) {
27 | if (storageCache.enabled !== 'Y') {
28 | return null;
29 | }
30 | return (storageCache.mockData || []).find((rule) => {
31 | if (!rule.active) {
32 | return false;
33 | }
34 | if (rule.reqMethod && rule.reqMethod.toLowerCase() !== method.toLowerCase()) {
35 | // 如果规则配置了method,而当前请求的method与规则不一致,则不匹配
36 | return false;
37 | }
38 | if (rule.reqType === 2) {
39 | // 正则匹配
40 | return new RegExp(rule.reqUrl, 'gi').test(url);
41 | }
42 | // 模糊匹配
43 | return url.indexOf(rule.reqUrl) >= 0;
44 | });
45 | }
46 |
47 | chrome.webRequest.onBeforeRequest.addListener(
48 | (details) => {
49 | const { url } = details;
50 | const { method } = details;
51 | const mockData = getMockData(url, method);
52 | if (mockData) {
53 | let requestBody = '';
54 |
55 | // 尝试将原始的请求体转为支持中文的字符串
56 | try {
57 | const uint8array = new Uint8Array(details.requestBody.raw[0].bytes);
58 | requestBody = new TextDecoder('utf-8').decode(uint8array);
59 | } catch (e) {
60 | console.error('Prase requestBody failed!', e);
61 | }
62 |
63 | let { responseText } = mockData;
64 | try {
65 | if (mockData.contentType.indexOf('application/json') >= 0) {
66 | responseText = JSON.stringify(mockjs.mock(JSON.parse(responseText)));
67 | }
68 | } catch (err) {
69 | console.error('Error when use mockjs:', err);
70 | }
71 | mockData.responseText = responseText;
72 |
73 | const data = {
74 | message: 'The request returned mock data. Please view it in Console!',
75 | mock: true,
76 | mockData,
77 | reqData: {
78 | url: details.url,
79 | method: details.method,
80 | body: requestBody,
81 | },
82 | };
83 | return {
84 | // 注意这里必须要 encodeURIComponent 一下,否则特殊字符会丢失
85 | redirectUrl: `data:application/json;charset=utf-8,${encodeURIComponent(JSON.stringify(data))}`,
86 | };
87 | }
88 |
89 | return {
90 | cancel: false,
91 | };
92 | },
93 | { urls: [''] },
94 | ['blocking', 'requestBody', 'extraHeaders'],
95 | );
96 |
--------------------------------------------------------------------------------
/src/components/vuetify-confirm/Confirm.vue:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 | {{ icon }}
13 |
14 |
15 |
16 |
17 |
18 |
25 | {{ buttonFalseText }}
26 |
27 |
34 | {{ buttonTrueText }}
35 |
36 |
37 |
38 |
39 |
40 |
41 |
135 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # chrome-extension-mocker
4 |
5 | A mock tool based on Chrome extension, no need to change any code, support dynamic mock data.
6 |
7 | If you want to use v1 version, switch to [axios-mocker](https://github.com/eshengsky/chrome-extension-mocker/tree/axios-mocker) branch.
8 |
9 | ## Why need mock requests
10 | * Instead of waiting for the dependent web service to develop and deploy, you just need to define the interface fields and the front back end can be developed in parallel.
11 | * Some web service may contaminate the data in the production environment, while the real request will not be sent by simulating the request and specifying the response you want.
12 | * Many times, the web service may return various types of responses, and developers and testers need to verify if it is working correctly under different returns, for example, when web service status code is 500, the page can be displayed as expected. Creating the data through normal operations can sometimes be particularly cumbersome or difficult, while using mock requests is convenient, and boundary testing can be done efficiently if you want to return what you want.
13 | * It is the base of TDD (test-driven development) and automated testing.
14 |
15 | ## Preview
16 | 
17 | 
18 |
19 | ## Download
20 |
21 | Download from [Chrome Web Store](https://chrome.google.com/webstore/detail/kfmkpfnmkjgcalngkpkjpjngjkfkjecl).
22 |
23 | Or, download and install as following:
24 |
25 | 1. Download the latest package in [Release](https://github.com/eshengsky/chrome-extension-mocker/releases/latest) page.
26 | 2. Open Chrome, enter `chrome://extensions/` in the address bar to enter the Chrome extension page, and check the `Developer mode`.
27 | 3. Drag the downloaded zip file to the page, and click on the `Add Extension` button.
28 |
29 | ## Usage
30 |
31 | In Chrome browser, press `Ctrl+Shift+I` or `⌘+⌥+I` to open dev tools, go to `Mocker` panel.
32 |
33 | Click the New button, and enter the mock data you want.
34 | In Match Request panel, set which requests need to match, and in Mock Response panel, set the simulate response you want to return.
35 |
36 | Note that if one request is matched, the original request will be redirected into a data uri, you can see details in Console panel.
37 |
38 | ## Development
39 |
40 | ```bash
41 | $ yarn serve
42 | ```
43 |
44 | ## Package
45 |
46 | ```bash
47 | $ yarn build
48 | ```
49 |
50 | ## Example
51 |
52 | ```bash
53 | $ cd example
54 | $ node server.js
55 | ```
56 |
57 | Visit http://localhost:8369/example/index.html.
58 |
59 | ## Licence
60 |
61 | MIT License
62 |
63 | Copyright (c) 2021 Sky.Sun 孙正华
64 |
65 | Permission is hereby granted, free of charge, to any person obtaining a copy
66 | of this software and associated documentation files (the "Software"), to deal
67 | in the Software without restriction, including without limitation the rights
68 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
69 | copies of the Software, and to permit persons to whom the Software is
70 | furnished to do so, subject to the following conditions:
71 |
72 | The above copyright notice and this permission notice shall be included in all
73 | copies or substantial portions of the Software.
74 |
75 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
76 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
77 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
78 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
79 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
80 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
81 | SOFTWARE.
82 |
--------------------------------------------------------------------------------
/src/components/MonacoEditor.vue:
--------------------------------------------------------------------------------
1 |
177 |
--------------------------------------------------------------------------------
/src/devtools/http-codes.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "code": 202,
4 | "phrase": "Accepted",
5 | "constant": "ACCEPTED",
6 | "comment": {
7 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.3",
8 | "description": "The request has been received but not yet acted upon. It is non-committal, meaning that there is no way in HTTP to later send an asynchronous response indicating the outcome of processing the request. It is intended for cases where another process or server handles the request, or for batch processing."
9 | }
10 | },
11 | {
12 | "code": 502,
13 | "phrase": "Bad Gateway",
14 | "constant": "BAD_GATEWAY",
15 | "comment": {
16 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.3",
17 | "description": "This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response."
18 | }
19 | },
20 | {
21 | "code": 400,
22 | "phrase": "Bad Request",
23 | "constant": "BAD_REQUEST",
24 | "comment": {
25 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.1",
26 | "description": "This response means that server could not understand the request due to invalid syntax."
27 | }
28 | },
29 | {
30 | "code": 409,
31 | "phrase": "Conflict",
32 | "constant": "CONFLICT",
33 | "comment": {
34 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.8",
35 | "description": "This response is sent when a request conflicts with the current state of the server."
36 | }
37 | },
38 | {
39 | "code": 100,
40 | "phrase": "Continue",
41 | "constant": "CONTINUE",
42 | "comment": {
43 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.1",
44 | "description": "This interim response indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished."
45 | }
46 | },
47 | {
48 | "code": 201,
49 | "phrase": "Created",
50 | "constant": "CREATED",
51 | "comment": {
52 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.2",
53 | "description": "The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request."
54 | }
55 | },
56 | {
57 | "code": 417,
58 | "phrase": "Expectation Failed",
59 | "constant": "EXPECTATION_FAILED",
60 | "comment": {
61 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.14",
62 | "description": "This response code means the expectation indicated by the Expect request header field can't be met by the server."
63 | }
64 | },
65 | {
66 | "code": 424,
67 | "phrase": "Failed Dependency",
68 | "constant": "FAILED_DEPENDENCY",
69 | "comment": {
70 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.5",
71 | "description": "The request failed due to failure of a previous request."
72 | }
73 | },
74 | {
75 | "code": 403,
76 | "phrase": "Forbidden",
77 | "constant": "FORBIDDEN",
78 | "comment": {
79 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.3",
80 | "description": "The client does not have access rights to the content, i.e. they are unauthorized, so server is rejecting to give proper response. Unlike 401, the client's identity is known to the server."
81 | }
82 | },
83 | {
84 | "code": 504,
85 | "phrase": "Gateway Timeout",
86 | "constant": "GATEWAY_TIMEOUT",
87 | "comment": {
88 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.5",
89 | "description": "This error response is given when the server is acting as a gateway and cannot get a response in time."
90 | }
91 | },
92 | {
93 | "code": 410,
94 | "phrase": "Gone",
95 | "constant": "GONE",
96 | "comment": {
97 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.9",
98 | "description": "This response would be sent when the requested content has been permenantly deleted from server, with no forwarding address. Clients are expected to remove their caches and links to the resource. The HTTP specification intends this status code to be used for \"limited-time, promotional services\". APIs should not feel compelled to indicate resources that have been deleted with this status code."
99 | }
100 | },
101 | {
102 | "code": 505,
103 | "phrase": "HTTP Version Not Supported",
104 | "constant": "HTTP_VERSION_NOT_SUPPORTED",
105 | "comment": {
106 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.6",
107 | "description": "The HTTP version used in the request is not supported by the server."
108 | }
109 | },
110 | {
111 | "code": 418,
112 | "phrase": "I'm a teapot",
113 | "constant": "IM_A_TEAPOT",
114 | "comment": {
115 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc2324#section-2.3.2",
116 | "description": "Any attempt to brew coffee with a teapot should result in the error code \"418 I'm a teapot\". The resulting entity body MAY be short and stout."
117 | }
118 | },
119 | {
120 | "code": 419,
121 | "phrase": "Insufficient Space on Resource",
122 | "constant": "INSUFFICIENT_SPACE_ON_RESOURCE",
123 | "comment": {
124 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6",
125 | "description": "The 507 (Insufficient Storage) status code means the method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. This condition is considered to be temporary. If the request which received this status code was the result of a user action, the request MUST NOT be repeated until it is requested by a separate user action."
126 | }
127 | },
128 | {
129 | "code": 507,
130 | "phrase": "Insufficient Storage",
131 | "constant": "INSUFFICIENT_STORAGE",
132 | "comment": {
133 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6",
134 | "description": "The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process."
135 | }
136 | },
137 | {
138 | "code": 500,
139 | "phrase": "Internal Server Error",
140 | "constant": "INTERNAL_SERVER_ERROR",
141 | "comment": {
142 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.1",
143 | "description": "The server encountered an unexpected condition that prevented it from fulfilling the request."
144 | }
145 | },
146 | {
147 | "code": 411,
148 | "phrase": "Length Required",
149 | "constant": "LENGTH_REQUIRED",
150 | "comment": {
151 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.10",
152 | "description": "The server rejected the request because the Content-Length header field is not defined and the server requires it."
153 | }
154 | },
155 | {
156 | "code": 423,
157 | "phrase": "Locked",
158 | "constant": "LOCKED",
159 | "comment": {
160 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.4",
161 | "description": "The resource that is being accessed is locked."
162 | }
163 | },
164 | {
165 | "code": 420,
166 | "phrase": "Method Failure",
167 | "constant": "METHOD_FAILURE",
168 | "isDeprecated": true,
169 | "comment": {
170 | "doc": "Official Documentation @ https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt",
171 | "description": "A deprecated response used by the Spring Framework when a method has failed."
172 | }
173 | },
174 | {
175 | "code": 405,
176 | "phrase": "Method Not Allowed",
177 | "constant": "METHOD_NOT_ALLOWED",
178 | "comment": {
179 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.5",
180 | "description": "The request method is known by the server but has been disabled and cannot be used. For example, an API may forbid DELETE-ing a resource. The two mandatory methods, GET and HEAD, must never be disabled and should not return this error code."
181 | }
182 | },
183 | {
184 | "code": 301,
185 | "phrase": "Moved Permanently",
186 | "constant": "MOVED_PERMANENTLY",
187 | "comment": {
188 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.2",
189 | "description": "This response code means that URI of requested resource has been changed. Probably, new URI would be given in the response."
190 | }
191 | },
192 | {
193 | "code": 302,
194 | "phrase": "Moved Temporarily",
195 | "constant": "MOVED_TEMPORARILY",
196 | "comment": {
197 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.3",
198 | "description": "This response code means that URI of requested resource has been changed temporarily. New changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests."
199 | }
200 | },
201 | {
202 | "code": 207,
203 | "phrase": "Multi-Status",
204 | "constant": "MULTI_STATUS",
205 | "comment": {
206 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.2",
207 | "description": "A Multi-Status response conveys information about multiple resources in situations where multiple status codes might be appropriate."
208 | }
209 | },
210 | {
211 | "code": 300,
212 | "phrase": "Multiple Choices",
213 | "constant": "MULTIPLE_CHOICES",
214 | "comment": {
215 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.1",
216 | "description": "The request has more than one possible responses. User-agent or user should choose one of them. There is no standardized way to choose one of the responses."
217 | }
218 | },
219 | {
220 | "code": 511,
221 | "phrase": "Network Authentication Required",
222 | "constant": "NETWORK_AUTHENTICATION_REQUIRED",
223 | "comment": {
224 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc6585#section-6",
225 | "description": "The 511 status code indicates that the client needs to authenticate to gain network access."
226 | }
227 | },
228 | {
229 | "code": 204,
230 | "phrase": "No Content",
231 | "constant": "NO_CONTENT",
232 | "comment": {
233 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.5",
234 | "description": "There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones."
235 | }
236 | },
237 | {
238 | "code": 203,
239 | "phrase": "Non Authoritative Information",
240 | "constant": "NON_AUTHORITATIVE_INFORMATION",
241 | "comment": {
242 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.4",
243 | "description": "This response code means returned meta-information set is not exact set as available from the origin server, but collected from a local or a third party copy. Except this condition, 200 OK response should be preferred instead of this response."
244 | }
245 | },
246 | {
247 | "code": 406,
248 | "phrase": "Not Acceptable",
249 | "constant": "NOT_ACCEPTABLE",
250 | "comment": {
251 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.6",
252 | "description": "This response is sent when the web server, after performing server-driven content negotiation, doesn't find any content following the criteria given by the user agent."
253 | }
254 | },
255 | {
256 | "code": 404,
257 | "phrase": "Not Found",
258 | "constant": "NOT_FOUND",
259 | "comment": {
260 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.4",
261 | "description": "The server can not find requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 to hide the existence of a resource from an unauthorized client. This response code is probably the most famous one due to its frequent occurence on the web."
262 | }
263 | },
264 | {
265 | "code": 501,
266 | "phrase": "Not Implemented",
267 | "constant": "NOT_IMPLEMENTED",
268 | "comment": {
269 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.2",
270 | "description": "The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD."
271 | }
272 | },
273 | {
274 | "code": 304,
275 | "phrase": "Not Modified",
276 | "constant": "NOT_MODIFIED",
277 | "comment": {
278 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.1",
279 | "description": "This is used for caching purposes. It is telling to client that response has not been modified. So, client can continue to use same cached version of response."
280 | }
281 | },
282 | {
283 | "code": 200,
284 | "phrase": "OK",
285 | "constant": "OK",
286 | "comment": {
287 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.1",
288 | "description": "The request has succeeded. The meaning of a success varies depending on the HTTP method:\nGET: The resource has been fetched and is transmitted in the message body.\nHEAD: The entity headers are in the message body.\nPOST: The resource describing the result of the action is transmitted in the message body.\nTRACE: The message body contains the request message as received by the server"
289 | }
290 | },
291 | {
292 | "code": 206,
293 | "phrase": "Partial Content",
294 | "constant": "PARTIAL_CONTENT",
295 | "comment": {
296 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.1",
297 | "description": "This response code is used because of range header sent by the client to separate download into multiple streams."
298 | }
299 | },
300 | {
301 | "code": 402,
302 | "phrase": "Payment Required",
303 | "constant": "PAYMENT_REQUIRED",
304 | "comment": {
305 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.2",
306 | "description": "This response code is reserved for future use. Initial aim for creating this code was using it for digital payment systems however this is not used currently."
307 | }
308 | },
309 | {
310 | "code": 308,
311 | "phrase": "Permanent Redirect",
312 | "constant": "PERMANENT_REDIRECT",
313 | "comment": {
314 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7538#section-3",
315 | "description": "This means that the resource is now permanently located at another URI, specified by the Location: HTTP Response header. This has the same semantics as the 301 Moved Permanently HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request."
316 | }
317 | },
318 | {
319 | "code": 412,
320 | "phrase": "Precondition Failed",
321 | "constant": "PRECONDITION_FAILED",
322 | "comment": {
323 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.2",
324 | "description": "The client has indicated preconditions in its headers which the server does not meet."
325 | }
326 | },
327 | {
328 | "code": 428,
329 | "phrase": "Precondition Required",
330 | "constant": "PRECONDITION_REQUIRED",
331 | "comment": {
332 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc6585#section-3",
333 | "description": "The origin server requires the request to be conditional. Intended to prevent the 'lost update' problem, where a client GETs a resource's state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict."
334 | }
335 | },
336 | {
337 | "code": 102,
338 | "phrase": "Processing",
339 | "constant": "PROCESSING",
340 | "comment": {
341 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.1",
342 | "description": "This code indicates that the server has received and is processing the request, but no response is available yet."
343 | }
344 | },
345 | {
346 | "code": 407,
347 | "phrase": "Proxy Authentication Required",
348 | "constant": "PROXY_AUTHENTICATION_REQUIRED",
349 | "comment": {
350 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.2",
351 | "description": "This is similar to 401 but authentication is needed to be done by a proxy."
352 | }
353 | },
354 | {
355 | "code": 431,
356 | "phrase": "Request Header Fields Too Large",
357 | "constant": "REQUEST_HEADER_FIELDS_TOO_LARGE",
358 | "comment": {
359 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc6585#section-5",
360 | "description": "The server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields."
361 | }
362 | },
363 | {
364 | "code": 408,
365 | "phrase": "Request Timeout",
366 | "constant": "REQUEST_TIMEOUT",
367 | "comment": {
368 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.7",
369 | "description": "This response is sent on an idle connection by some servers, even without any previous request by the client. It means that the server would like to shut down this unused connection. This response is used much more since some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing. Also note that some servers merely shut down the connection without sending this message."
370 | }
371 | },
372 | {
373 | "code": 413,
374 | "phrase": "Request Entity Too Large",
375 | "constant": "REQUEST_TOO_LONG",
376 | "comment": {
377 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.11",
378 | "description": "Request entity is larger than limits defined by server; the server might close the connection or return an Retry-After header field."
379 | }
380 | },
381 | {
382 | "code": 414,
383 | "phrase": "Request-URI Too Long",
384 | "constant": "REQUEST_URI_TOO_LONG",
385 | "comment": {
386 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.12",
387 | "description": "The URI requested by the client is longer than the server is willing to interpret."
388 | }
389 | },
390 | {
391 | "code": 416,
392 | "phrase": "Requested Range Not Satisfiable",
393 | "constant": "REQUESTED_RANGE_NOT_SATISFIABLE",
394 | "comment": {
395 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.4",
396 | "description": "The range specified by the Range header field in the request can't be fulfilled; it's possible that the range is outside the size of the target URI's data."
397 | }
398 | },
399 | {
400 | "code": 205,
401 | "phrase": "Reset Content",
402 | "constant": "RESET_CONTENT",
403 | "comment": {
404 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.6",
405 | "description": "This response code is sent after accomplishing request to tell user agent reset document view which sent this request."
406 | }
407 | },
408 | {
409 | "code": 303,
410 | "phrase": "See Other",
411 | "constant": "SEE_OTHER",
412 | "comment": {
413 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.4",
414 | "description": "Server sent this response to directing client to get requested resource to another URI with an GET request."
415 | }
416 | },
417 | {
418 | "code": 503,
419 | "phrase": "Service Unavailable",
420 | "constant": "SERVICE_UNAVAILABLE",
421 | "comment": {
422 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.4",
423 | "description": "The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This responses should be used for temporary conditions and the Retry-After: HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached."
424 | }
425 | },
426 | {
427 | "code": 101,
428 | "phrase": "Switching Protocols",
429 | "constant": "SWITCHING_PROTOCOLS",
430 | "comment": {
431 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.2",
432 | "description": "This code is sent in response to an Upgrade request header by the client, and indicates the protocol the server is switching too."
433 | }
434 | },
435 | {
436 | "code": 307,
437 | "phrase": "Temporary Redirect",
438 | "constant": "TEMPORARY_REDIRECT",
439 | "comment": {
440 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.7",
441 | "description": "Server sent this response to directing client to get requested resource to another URI with same method that used prior request. This has the same semantic than the 302 Found HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request."
442 | }
443 | },
444 | {
445 | "code": 429,
446 | "phrase": "Too Many Requests",
447 | "constant": "TOO_MANY_REQUESTS",
448 | "comment": {
449 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc6585#section-4",
450 | "description": "The user has sent too many requests in a given amount of time (\"rate limiting\")."
451 | }
452 | },
453 | {
454 | "code": 401,
455 | "phrase": "Unauthorized",
456 | "constant": "UNAUTHORIZED",
457 | "comment": {
458 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.1",
459 | "description": "Although the HTTP standard specifies \"unauthorized\", semantically this response means \"unauthenticated\". That is, the client must authenticate itself to get the requested response."
460 | }
461 | },
462 | {
463 | "code": 451,
464 | "phrase": "Unavailable For Legal Reasons",
465 | "constant": "UNAVAILABLE_FOR_LEGAL_REASONS",
466 | "comment": {
467 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7725",
468 | "description": "The user-agent requested a resource that cannot legally be provided, such as a web page censored by a government."
469 | }
470 | },
471 | {
472 | "code": 422,
473 | "phrase": "Unprocessable Entity",
474 | "constant": "UNPROCESSABLE_ENTITY",
475 | "comment": {
476 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.3",
477 | "description": "The request was well-formed but was unable to be followed due to semantic errors."
478 | }
479 | },
480 | {
481 | "code": 415,
482 | "phrase": "Unsupported Media Type",
483 | "constant": "UNSUPPORTED_MEDIA_TYPE",
484 | "comment": {
485 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.13",
486 | "description": "The media format of the requested data is not supported by the server, so the server is rejecting the request."
487 | }
488 | },
489 | {
490 | "code": 305,
491 | "phrase": "Use Proxy",
492 | "constant": "USE_PROXY",
493 | "isDeprecated": true,
494 | "comment": {
495 | "doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.6",
496 | "description": "Was defined in a previous version of the HTTP specification to indicate that a requested response must be accessed by a proxy. It has been deprecated due to security concerns regarding in-band configuration of a proxy."
497 | }
498 | },
499 | {
500 | "code": 421,
501 | "phrase": "Misdirected Request",
502 | "constant": "MISDIRECTED_REQUEST",
503 | "isDeprecated": false,
504 | "comment": {
505 | "doc": "Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7540#section-9.1.2",
506 | "description": "Defined in the specification of HTTP/2 to indicate that a server is not able to produce a response for the combination of scheme and authority that are included in the request URI."
507 | }
508 | }
509 | ]
--------------------------------------------------------------------------------
/src/devtools/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |