Skip to main content

URL Request

wrapper for urllib.request.urlopen

Very limited drop-in replacement for requests when you cant import requests and need to use the built in urllib.request library

Supports (url,data,json,headers,timeout,auth)

Optional: Added (method) to be used in place to .post .get .etc takes: 'POST','GET','PUT','DELETE','HEAD','PATCH'

Added (callraise) default is true and will raise exceptions, false will disable exceptions.

Can be used via pip or just copy the class into your project

pip install urlrequest
from urlrequest import UrlRequest
response = UrlRequest('https://httpbin.org/ip')
print(response.text)
print(response.status_code)
print(response.headers)
print(response.json())

response = UrlRequest("https://httpbin.org/basic-auth/user/password",auth=('user','password'))
print(response.text)

response = UrlRequest("https://httpbin.org/post",method="POST",json={"hello":"world"})
print(response.text)

response = UrlRequest("https://httpbin.org/image/png")
with open("test.png","wb") as f:
    f.write(response.raw)
print(response.status_code)

# drop in for requests
from urlrequest import UrlRequest as requests
response = requests.get("https://httpbin.org/headers",headers={"hello":"world header test"})
print(response.text)

Metadata

Release files for urlrequest 1.0.4

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

Source distribution (sdist)

Source distribution for urlrequest 1.0.4
File Size Uploaded Provenance Actions
urlrequest-1.0.4.tar.gz 4.3 kB Without provenance Details for urlrequest-1.0.4.tar.gz

Built distribution (wheel)

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

Total release size: 8.6 kB

Release files / urlrequest-1.0.4.tar.gz

Download URL urlrequest-1.0.4.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
879e0d502eb482371da91b3d5b17f9a462a92625e38318d100192639b35fdb9b
BLAKE2b-256 checksum
How to use checksums
3a3568a207847d1bc9ab3500e256bc1cf8c6f28b5706f413a6c76820a36f3043
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / urlrequest-1.0.4-py3-none-any.whl

Download URL urlrequest-1.0.4-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db90ed41b55ecfb9847e5312b48d9ada687c1d4cb82f5505e145ebed9a6ae70a
BLAKE2b-256 checksum
How to use checksums
d940bc8c5426247c6ed2abf5d3f7c7961106e0a9d0273c00a5dfec498887e5cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for urlrequest 1.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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