Skip to main content

HttpClientMultipart

Description

This package implement client to upload file using HTTP multipart.

Requirements

This package require :

  • python3
  • python3 Standard Library

Installation

pip install HttpClientMultipart

Usages

Command line

HttpMultipart -h                                                                                             # Print help message
HttpMultipart --help                                                                                         # Print help message
HttpMultipart -u "http://example.com/post/file"
python3 -m HttpMultipart --url "http://example.com/post/file"                                                # Using module command line
python3 HttpMultipart.pyz -H "Referer:http://example.com/" "Cookie:S=123" -u "http://example.com/post/file"  # Using python executable file, add headers
HttpMultipart --add-headers "Referer:http://example.com/" "Cookie:S=123" -u "http://example.com/post/file"   # Add headers
HttpMultipart -p "submit:Upload" -u "http://example.com/post/file"                                           # Add simple field
HttpMultipart --add-parameters "submit:Upload" -u "http://example.com/post/file"                             # Add simple field
HttpMultipart -f "/home/user/test.csv" -u "http://example.com/post/file"                                     # Add file
HttpMultipart --files-path "/home/user/test.csv" -u "http://example.com/post/file"                           # Add file

Python script

from HttpClientMultipart import Multipart
from urllib.request import Request, urlopen

multipart = Multipart()

response = urlopen(
    Request("http://example.com/post/file",
        headers={'Content-Type': multipart.content_type},
        data=multipart.build_multipart([("SubmitButton", "Upload file")], [("file", "test.csv", "/home/user/test.csv")]),
    )
)

print(response.read())

License

Licensed under the GPL, version 3.

Metadata

Release files for HttpClientMultipart 0.0.1

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

Source distribution (sdist)

Source distribution for HttpClientMultipart 0.0.1
File Size Uploaded
HttpClientMultipart-0.0.1.tar.gz 17.5 kB Details

Release files / HttpClientMultipart-0.0.1.tar.gz

Download URL HttpClientMultipart-0.0.1.tar.gz
Size 17.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2692a256332f664d2e18f72bf89d1f15f6327c30cf7dc6d4cc94a1b144674d29
BLAKE2b-256 checksum
How to use checksums
e6c6ccb4946dafd0d02e0426e925527612eafb089417b9592b981ab07ff5fba9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.2

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file

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