import requests
from requests.exceptions import HTTPError

try:

    dataToPass ={
    "p1": 0.1,
    "p2": 100,
    "p3": 1,
    "p4": 10
}

    response = requests.post(url='http://localhost:8002/run',
                             json=dataToPass)
    response.raise_for_status()
    # access JSOn content
    jsonResponse = response.json()
    print(jsonResponse)

except HTTPError as http_err:
    print(f'HTTP error occurred: {http_err}')
except Exception as err:
    print(f'Other error occurred: {err}')
