Convert CURL commands to Javascript XHR code online

Curl command

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

CURL to Javascript XHR Online

This tool helps you to generate Javascript XHR code based on CURL Command. Copy and Paste CURL Command and Generate Javascript XHR.

What can you do with CURL to Javascript XHR Converter Online?

  • CURL to Javascript XHR is very unique tool to convert cURL command to Javascript XHR request of Javascript XHR. The input provide by the user's cURL command to generate Javascript XHR Code.
  • This tool saves your time and helps to generate Javascript XHR code with ease.
  • CURL to Javascript XHR works well on Windows, MAC, Linux, Chrome, Firefox, Edge and Safari.

what is CURL?

cURL is an open-source command line tool that downloads files from the web. It supports a variety of protocols, including Javascript XHR, Javascript XHRS, FTP, SFTP, TFTP, Gopher and others.

How do convert CURL to Javascript XHR code? 

Step1: Paste and convert your CURL requests to Javascript XHR code

Step2: Copy Javascript XHR code

Convert CURL to Javascript XHR example

CURL
curl example.com
Javascript XHR
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://example.com/");

xhr.send(data);