A class to make HTTP REST requests
Project description
fgslpyrest
Python component to make HTTP RESTful requests.
How to install
pip install fgslpyrest
Using the component
Making a HTTP GET request in the terminal
The sequence of commands below make a HTTP GET request and check if the response has the word "German". The response, in this case, is HTML. The last parameter enables verbose output.
$ python
>>> from fgslpyrest.http.Rest import Rest
>>> rest = Rest()
>>> response = rest.doGet([],"https://time.is/pt_br/UTC",200,True)
>>> print(response.find("German"))
The next sequence of commands make a HTTP request which returns a JSON object.
$ python
>>> import json
>>> from fgslpyrest.http.Rest import Rest
>>> rest = Rest()
>>> response = rest.doGet([],"https://reqres.in/api/users/2",200)
>>> user = json.loads(response)
>>> print(user["data"]["email"])
For developers
- PKG-INFO describes the package in a summarized way.
- MANIFEST.in defines which files will be included into the package.
- pyproject.toml defines the general packaging information.
More information at https://packaging.python.org/en/latest/tutorials/packaging-projects/
Building the package
python -m build --sdist .
Requires build
module. You can install it using pip install build
.
Upload the package to PyPI
twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fgslpyrest-1.1.1.tar.gz
(15.0 kB
view details)
File details
Details for the file fgslpyrest-1.1.1.tar.gz
.
File metadata
- Download URL: fgslpyrest-1.1.1.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 074e5737b6ceea497ecc5eb137634be6ebddd380a5015bd8e17ae8aec19fbbe8 |
|
MD5 | ff3281112c2c120e0caa400c15e5bcc8 |
|
BLAKE2b-256 | 562d55e7e08a3ae811da26d3f78dc9d862dbc5c3619c7582c335c5a1bfc1420c |