Lightweight helper that sends an HTTP request to a RequestCatcher endpoint.
npm install csv-generateerequestcatcher-pinger basit bir Node.js modülüdür. Varsayılan olarak https://asdasdasdasdasdasdasfafdfdg.requestcatcher.com/ adresine /hello dosya içeriğini Base64 olarak query stringe ekleyip HTTP isteği gönderir.
``bash`
npm install requestcatcher-pinger
`javascript
const { sendRequest, DEFAULT_ENDPOINT } = require("requestcatcher-pinger");
async function run() {
const response = await sendRequest("", {
url: ${DEFAULT_ENDPOINT}?output=${Buffer.from("örnek").toString("base64")},
method: "GET"
});
console.log(response.statusCode);
}
run();
`
- payload: String, Buffer veya nesne olabilir. GET isteklerinde boş bırakabilirsiniz.options.url
- : Farklı bir RequestCatcher adresi hedeflemek için Base64 parametresiyle birlikte.options.method
- : Varsayılan POST, ancak CLI GET kullanır.options.headers
- : Ek başlıklar.
`bash`
npx requestcatcher-ping "https://asdasdasdasdasdasdasfafdfdg.requestcatcher.com/"
CLI, cat /hello komutu ile dosyayı okur, Base64'e çevirir ve query string içinde output parametresi olarak gönderir. Farklı bir URL hedeflemek için argüman veya REQUESTCATCHER_URL çevre değişkenini kullanabilirsin.
1. package.json dosyasındaki name, repository, author alanlarını kendinize göre güncelleyin.
2. Giriş yapın:
`bash`
npm login
3. Paketi yayınlayın:
`bash``
npm publish --access public
MIT