Skip to main content

Generate curl commands from python-requests

Project description

rcurl

A simple package of generating curl statements from requests.

For now the supported methods are limited. Checl the samples in usage

Installation

pip install rcurl

Usage

import json

import requests

from rcurl import get_curl

req_one = requests.get("https://google.com")
curl_command_one = get_curl(req_one)

req_two = requests.post("https://google.com")
curl_command_two = get_curl(req_two)

data = json.dumps({'a': 'b', 'x': 45})
headers = {
    'content-type': 'application/json',
    'authorization': 'Bearer dhsfdJGHGDH'
}
req_three = requests.post("https://google.com", data=data, headers=headers)
curl_command_three = get_curl(req_three)

print (curl_command_one)
print (curl_command_two)
print (curl_command_three)

Build

python setup.py bdist_wheel sdist
twine upload dist/*

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

rcurl-0.0.2.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

rcurl-0.0.2-py3-none-any.whl (2.0 kB view details)

Uploaded Python 3

File details

Details for the file rcurl-0.0.2.tar.gz.

File metadata

  • Download URL: rcurl-0.0.2.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

File hashes

Hashes for rcurl-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a0f7fac4cb8e49739a2951833a7fbb8f0be2d808f24029eafad35cfd184c6a53
MD5 ed9d8af3b7b76af0997549ae8304566e
BLAKE2b-256 f133dc8d3c943b6eee64248c1d72a3e5daa7a51f9d18aa6291bd01830179b377

See more details on using hashes here.

File details

Details for the file rcurl-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: rcurl-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

File hashes

Hashes for rcurl-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 680674833438e24295630c5310cc5aa6ba202299f2fb33bf8ae86fb6f3de81f9
MD5 9a618a1350e5c280fa145ea23c36fe4b
BLAKE2b-256 7ec7f9f070a787c8af6eb7d35e5ba56c0cc60ed6c219fc4bc6237e292e2c8faf

See more details on using hashes here.

Supported by

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