Registry / http-networking / requests-toolbelt

requests-toolbelt

JSON →
library1.0.0pypypi✓ verified 27d ago

A utility belt for advanced users of python-requests, providing additional functionality and tools. Current version: 1.0.0. Release cadence: As needed.

pip install requests-toolbelt
INSTALL
IMPORT
SIG · REQUESTS-TOOLBELT
R
requests-toolbelt
http-networkingpythonv1.0.0
Install
2.4s avg
Import
399ms
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.410s · 21.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.4s · import 0.388s · 22MB
20MB installed
● package 20MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MultipartEncoder
from requests_toolbelt.multipart.encoder import MultipartEncoder
Ensure correct import path to access MultipartEncoder class.

Example of using MultipartEncoder from requests_toolbelt to send a multipart/form-data POST request.

import requests from requests_toolbelt.multipart.encoder import MultipartEncoder url = 'http://httpbin.org/post' m = MultipartEncoder(fields={'field0': 'value0', 'field1': 'value1'}) response = requests.post(url, data=m, headers={'Content-Type': m.content_type}) print(response.text)
Debug
Known issues
breakingEnsure correct import paths to avoid ImportError.
fix
Use 'from requests_toolbelt.multipart.encoder import MultipartEncoder' for MultipartEncoder.
affects: 1.0.0
gotchaAlways set the 'Content-Type' header to the value of m.content_type when using MultipartEncoder.
fix
Include headers={'Content-Type': m.content_type} in your requests.
affects: 1.0.0
Upgrade
Version history
1.0.0latest on PyPI · released May 1, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
requests-toolbelt — pip install requests-toolbelt · libregistry