Ngonversi perintah CURL dadi kode HTTP Node kanthi online

Curl command

Examples: GET - POST - JSON - Basic Auth - Files - Form

CURL menyang Node HTTP online

Alat iki mbantu sampeyan ngasilake kode HTTP Node adhedhasar printah CURL. Salin lan tempel printah CURL lan ngasilake Node HTTP.

Apa sampeyan bisa nindakake karo konverter CURL menyang Node HTTP online?

  • CURL to Node HTTP minangka alat sing unik banget kanggo ngonversi perintah CURL menyang request Node HTTP saka Node HTTP. Input kasebut diwenehake dening perintah CURL pangguna kanggo ngasilake kode HTTP Node.
  • Alat iki ngirit wektu lan mbantu nggawe kode HTTP Node kanthi gampang.
  • CURL to Node HTTP bisa digunakake ing Windows, MAC, Linux, Chrome, Firefox, Edge lan Safari.

apa iku CURL?

CURL minangka alat baris perintah open-source sing ndownload file saka web. Ndhukung macem-macem protokol, kalebu Node HTTP, Node HTTPS, FTP, SFTP, TFTP, Gopher lan liya-liyane.

Kepiye carane ngowahi CURL dadi kode HTTP Node? 

Step1: Tempel lan ngowahi panjalukan CURL menyang kode HTTP Node

Step2: Nyalin kode HTTP Node

Ngonversi CURL dadi conto HTTP Node

KULIT
curl example.com
Node HTTP
const http = require("http");

const options = {
  "method": "GET",
  "hostname": "example.com",
  "port": null,
  "path": "/",
  "headers": {}
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();