/fgslpyrest

Python component to make HTTP Restful requests

Primary LanguagePythonGNU Affero General Public License v3.0AGPL-3.0

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.

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/*