Skip to main content

cURL2

cURL code convert to some programming languages.

Thanks for curlconverter!

Currently supported languages: go, python, node, php, r, strest, rust, elixir, dart, json, ansible, matlab, etc.

Install curl2

pip3 install -U curl2

How to use

Python

curl2 -c "curl https://leesoar.com"
  • OutPut
import requests

response = requests.get('https://leesoar.com/')

Go

curl2 -c "curl https://leesoar.com -l go"
  • OutPut
package main

import (
        "fmt"
        "io/ioutil"
        "log"
        "net/http"
)

func main() {
        client := &http.Client{}
        req, err := http.NewRequest("GET", "https://leesoar.com", nil)
        if err != nil {
                log.Fatal(err)
        }
        resp, err := client.Do(req)
        if err != nil {
                log.Fatal(err)
        }
        bodyText, err := ioutil.ReadAll(resp.Body)
        if err != nil {
                log.Fatal(err)
        }
        fmt.Printf("%s\n", bodyText)
}

node

curl2 -c "curl https://leesoar.com -l node"
  • OutPut
var request = require('request');

var options = {
    url: 'https://leesoar.com'
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

php

curl2 -c "curl https://leesoar.com -l php"
  • OutPut
<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$headers = array();
$response = Requests::get('https://leesoar.com', $headers);

Metadata

Release files for curl2 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for curl2 1.1.2
File Size Uploaded
curl2-1.1.2.tar.gz 84.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for curl2 1.1.2
File Interpreter ABI Platform
curl2-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 168.7 kB

Release files / curl2-1.1.2.tar.gz

Download URL curl2-1.1.2.tar.gz
Size 84.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3b8b1cdccc7e277374db39a8e4d0d2356ca3bd3c1c4cff688c5b9f36d1e96509
BLAKE2b-256 checksum
How to use checksums
536a749ccd88e33bd653069c2ebb3c76e9e55d4c9da8be25107afa176e550217
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.0.2rc1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.6

Release files / curl2-1.1.2-py3-none-any.whl

Download URL curl2-1.1.2-py3-none-any.whl
Size 84.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85fa34c86ae43a4e30fe94249454d6ab41b1a4a2ef0aa8f6658feec0e4406b8d
BLAKE2b-256 checksum
How to use checksums
b81b82ee770ef0f3f90ef54f2a413fc995a34ff1755ae286a08dd3f881fd9c3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.0.2rc1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.6

Release history Release notifications | RSS feed

This release

1.1.2 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page