Một mục mã nguồn mở trong kho dữ liệu GitHub của TopGit: request/request-debug, 141 sao, JavaScript. Library to monitor HTTP(S) requests made with mikeal/request.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
This Node.js module provides an easy way to monitor HTTP(S) requests performed
by the request module, and their
responses from external servers.
Usage
Basic usage is to require the module and call it, passing in the object
returned by require('request'):
var request = require('request');
require('request-debug')(request);
This will set up event handlers on every request performed with the request
variable from this point.
You can also specify a function to handle request or response data:
require('request-debug')(request, function(type, data, r) {
// put your request or response handling logic here
});
If you specify your own handling function, r will be the Request instance
that generated the event, and type will be one of the following values:
request - Headers were sent to the server and will be included as
data.headers. data.body may also be present for POST requests.
response - Headers were received from the server and will be included as
data.headers. Note that request only buffers the response body if a
callback was given, so it will only be available as data.body if the
initial call to request included a callback.
redirect - A redirect status code (HTTP 3xx) was received. The data
object will have properties statusCode, headers, and uri (the address
of the next request).
auth - A HTTP 401 Unathorized response was received. Internally,
request handles this like a redirect, so the same properties will be
available on the data object.
You can use the data.debugId parameter to match up requests with their
responses and other events.
The default handling function writes the data to stderr in Node's JSON-like
object display format. See the example below for more details.
To disable debugging, call request.stopDebugging() (this function only exists
if debugging has already been enabled). Any requests that are in progress when
stopDebugging() is called will still generate debug events.
Example
var request = require('request');
require('request-debug')(request);
// digest.php is example 2 from:
// http://php.net/manual/en/features.http-auth.php
request({
uri : 'http://nylen.tv/digest.php',
auth : {
user : 'admin',
pass : 'mypass',
sendImmediately : false
},
rejectUnauthorized : false,
}, function(err, res, body) {
console.log('REQUEST RESULTS:', err, res.statusCode, body);
});
Unless you provide your own function as the second parameter to the
request-debug call, this will produce console output similar to the
following:
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/request/request-debug là nguồn chính thức.
request/request-debug có bao nhiêu sao?
request/request-debug có 141 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/request/request-debug. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
request/request-debug có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho request/request-debug. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
request/request-debug còn đang phát triển không?
Commit gần nhất trên request/request-debug là 6.8 năm trước (theo timestamp GitHub). Repo có 18 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
request/request-debug viết bằng ngôn ngữ gì?
request/request-debug chủ yếu viết bằng JavaScript. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc request-debug có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về request-debug.