Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mauricelambert/httpclientmultipart
This package implement client to upload file using HTTP multipart
https://github.com/mauricelambert/httpclientmultipart
client form-data http multipart pypi-package python3
Last synced: about 10 hours ago
JSON representation
This package implement client to upload file using HTTP multipart
- Host: GitHub
- URL: https://github.com/mauricelambert/httpclientmultipart
- Owner: mauricelambert
- License: gpl-3.0
- Created: 2021-07-04T19:56:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-07-04T20:39:37.000Z (over 3 years ago)
- Last Synced: 2023-11-30T11:20:41.410Z (12 months ago)
- Topics: client, form-data, http, multipart, pypi-package, python3
- Language: Python
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# HttpClientMultipart
## Description
This package implement client to upload file using HTTP multipart.
## Requirements
This package require :
- python3
- python3 Standard Library## Installation
```bash
pip install HttpClientMultipart
```## Usages
### Command line
```bash
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
```python
from HttpClientMultipart import Multipart
from urllib.request import Request, urlopenmultipart = 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())
```## Links
- [Pypi](https://pypi.org/project/HttpClientMultipart)
- [Github](https://github.com/mauricelambert/HttpClientMultipart)
- [Documentation](https://mauricelambert.github.io/info/python/code/HttpClientMultipart.html)
- [Python executable](https://mauricelambert.github.io/info/python/code/HttpClientMultipart.pyz)## License
Licensed under the [GPL, version 3](https://www.gnu.org/licenses/).