...
If you didn’t configure you project first check Project Configuration.
Request
PEKAT can handle two types of requests:
POST request - for analyzing images
GET request - for getting the last analyzed image and pinging the project
Both requests take an URL as an argument, that needs to be constructed from the target projects IP, port, requested command, response type and possibly some additional arguments.
The POST and GET requests and their different uses will be explained later on this page, but first we’ll focus on how to find out the IP address and port number of the target project.
URL
The URL for the requests would generally look like this:
Code Block | ||
---|---|---|
| ||
url = f"http://{ip}:{port}/{path}?response_type={response_type}" |
But depending on the response type you may need to add arguments to the URL, in which case it would be modified to look like this:
Code Block | ||
---|---|---|
| ||
url = f"http://{ip}:{port}/{path}?response_type={response_type}&{argument1}={value1}&{argument2}={value2}&..." |
IP address
The IP address that needs to be in the URL is the address of the machine on which the project is running. Alternatively, if the project is running on the same machine on from which you’ll be sending the requests, you can use address 127.0.0.1.
Port
The port in the URL is the port of the PEKAT project you want to connect to. The port can be found in Projects manager and it can be modified before starting the project.
...
POST request
The sending address consists of the IP address, port, type, and optional further query parameters. The request method must be of ‘POST’ type and the content type of ‘application/octet-stream’ type.
...
It is necessary to specify the IP address of the PC that is going to send the images. To do this navigate to Input → Host panel and modify the IP address.
...
Port
This is selected when starting the project, the default is 8000.
...