Skip to main content

cURL To Lang

Project description

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);

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

curl2-1.1.2.tar.gz (84.0 kB view details)

Uploaded Source

Built Distribution

curl2-1.1.2-py3-none-any.whl (84.7 kB view details)

Uploaded Python 3

File details

Details for the file curl2-1.1.2.tar.gz.

File metadata

  • Download URL: curl2-1.1.2.tar.gz
  • Upload date:
  • Size: 84.0 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for curl2-1.1.2.tar.gz
Algorithm Hash digest
SHA256 3b8b1cdccc7e277374db39a8e4d0d2356ca3bd3c1c4cff688c5b9f36d1e96509
MD5 e9ab042c4570144ccf0f41a17b7004d5
BLAKE2b-256 536a749ccd88e33bd653069c2ebb3c76e9e55d4c9da8be25107afa176e550217

See more details on using hashes here.

File details

Details for the file curl2-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: curl2-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 84.7 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for curl2-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 85fa34c86ae43a4e30fe94249454d6ab41b1a4a2ef0aa8f6658feec0e4406b8d
MD5 1f5d6ba4932955ffdab176cf0fc906dd
BLAKE2b-256 b81b82ee770ef0f3f90ef54f2a413fc995a34ff1755ae286a08dd3f881fd9c3d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page