Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 1.33 KB

File metadata and controls

49 lines (34 loc) · 1.33 KB

Python REST Execution Sample

Overview

This folder contains executeREST.py, a minimal Python client that sends a JSON payload to a Corticon Server REST endpoint.

Quick Start

  1. Create and activate a virtual environment.
  2. Install dependencies.
  3. Update endpoint and payload path values in executeREST.py.
  4. Run the script and review the JSON response.
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install requests
python executeREST.py

Configure Server Details

Edit these variables in executeREST.py:

  • corticonServerProtocol: use https when SSL/TLS is enabled.
  • corticonServerAddress: target host name or IP.
  • corticonServerPort: server listening port (for example 8080).
  • corticonServerPath: endpoint path (for example /axis/corticon/execute).

Configure Payload File

  • Create a JSON payload file (for example input.json).
  • Update jsonFilePath in executeREST.py to your payload location.

Optional Authentication

If your API requires authentication, add the appropriate header to the requests.post(...) call. For example:

headers={
	'Content-type': 'application/json',
	'Authorization': 'Bearer <token>'
}

Naming and Discoverability

  • README terminology now matches the actual script file (executeREST.py).
  • Existing directory names and slugs are unchanged.