Skip to main content

Pytonik curl

Build Status Downloads Wheel Python Version License

Pytonik curl module support sending or initiating actions within or outside. It enables access to API’s and return respond back to the application, in form of JSON, HTML, RAW data etc. In this case the use of curl module is to POST, GET, HEAD, PUT information in internal or from external API’s URL using attributes like status, reason, and result. Whereby status handles response codes example 200, 404, 500, etc. which the reason of this status could be OK, Not Found, Internal server Error, etc. Get excepted information from result

Made with python

How to install

We recommend you to install pytonik package using Terminal or Command Line Window

$ pip install pytonik-curl=2.0

Import Module

from pytonik_curl.curl import curl

Callable

cl = curl()

Curl Local Variable

URL #accept url link
HTTPHEADER #httpheader  application/x-www-form-urlencoded etc.
CONTENTHEADER #accept text/plain, html/plain etc.
HEADER #accept {'Accept': 'Value'}etc.
TIMEOUT #accept
POSTFIELDS #accept dictionary formate {name: example, next: testing}
POST #accept folder or url part / or /mypath
GET	#accept folder or url part / or /mypath
HEAD #accept folder or url part / or /mypath
PUT #accept folder or url part / or /mypath
PORT #accept url port 8080

GET retrieves information from api’s server and returns response status , reason, and result

url = "https://example.com"
cl = curl()
cl.set(cl.URL, url)
cl.set(cl.GET, '/users/{username}'.format(username='testme'))
cl.finish()
print(cl.status, cl.reason, cl.result())

HEAD check api’s and returns response status and reason

url = "https://example.com"
cl = curl()
cl.set(cl.URL, url)
cl.set(cl.HEAD, '/users')
cl.finish()
print(cl.status, cl.reason)

POST sent data/information to api using parameters or arguments and returns response status , reason, and result

url = "https://example.com"
cl = curl()
cl.set(cl.URL, url)
cl.set(cl.CONTENTHEADER, 'application/x-www-form-urlencoded')
cl.set(cl.ACCEPTHEADER, 'text/plain')
cl.set(cl.POST, '/add/users')
cl.set(cl.POSTFIELDS, {'username':'testme', 'password':'test' })
cl.finish()
print(cl.status, cl.reason, cl.result('utf-8'))

Contact

Name: Pytonik MVC

Email: dev@pytonik.com

Metadata

Release files for pytonik-curl 2.0

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

Source distribution (sdist)

Source distribution for pytonik-curl 2.0
File Size Uploaded
pytonik curl-2.0.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytonik-curl 2.0
File Interpreter ABI Platform
pytonik_curl-2.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.6 kB

Release files / pytonik curl-2.0.tar.gz

Download URL pytonik curl-2.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ddee1ecc4f60b12d26d80083814aee8a260135b92cc32a1f4d66c4c24683d75c
BLAKE2b-256 checksum
How to use checksums
ac9820d5e61e641bb1e382763fed09e51fecb54d6b37374a343353f9a1cbee99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

Release files / pytonik_curl-2.0-py3-none-any.whl

Download URL pytonik_curl-2.0-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea4d7a63a0112281b8a6cb3f218469e6f99a543f2d334ae977f9e4a56c033194
BLAKE2b-256 checksum
How to use checksums
64781542693a91a8b79f9dff85643729336fc8b527ff394f78e2c1e41b5a5bdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

2.0 This release

2 release files

1.0

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