Skip to main content

Execute API method by HTTP

Project description

Eugenia's http executor

Method to call http API

Installation

Use pip:

pip install ehttp-executor

Please use Python 3.8 and above

How to use

Create the input dictionary, then invoke the method with these parameters:

  • HTTP URL
  • Process name
  • Input dictionary

Example:

from ehttp_executor.ehttp_caller import call_python_api

input_data = {
"status": "Loaded",
"statusCode": 404,
"testDate": "16/07/2030",
"abruptEnd": True,
"logs": [
    "Rodrigo logged in",
    "Henry logged in",
    "Rodrigo logged out",
    "Henry logged out"
],
"developers": [
    {
    "name": "Rodrigo",
    "age": 43,
    "logins": [
        {
        "loginInfo": "Login saturday 5AM"
        },
        {
        "loginInfo": "Logout saturday 8AM"
        }
    ]
    },
    {
    "name": "Henry",
    "age": 46,
    "logins": [
        {
        "loginInfo": "Login thursday 9AM"
        },
        {
        "loginInfo": "Logout monday 11AM"
        }
    ]
    }
]
}
json_output = call_python_api("http://localhost:5000/", "PythonBBasic261020211724", input_data)
print (type(json_output))
print (json_output)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ehttp-executor-1.0.0.tar.gz (2.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page