Send Requests
Use these guidelines when sending requests using the REST API for AI and ML services.
URL Structure
The URL structure for the requests is
apiRoot/resourcePath
where:
-
apiRoot is the URL for accessing the HTTP Gateway server at either http://hostname:Port or https://hostname:Port.
-
resourcePath is the path to the endpoint.
http://hostname:port/data/fetchwhere:
-
hostname is the host name for the application server.
-
port is the port for the application server.
Supported Methods
You can perform create and read operations on a resource using method requests. This table shows the supported methods.
| HTTP Method | Description |
|---|---|
POST |
Create the resource. |
Media Types
The REST API for AI and ML services supports the following media types:
application/json
Supported Headers
The REST API for AI and ML services supports the following headers that may be passed in the header section of the HTTP/HTTPS request or response:
| Header | Description | Example |
|---|---|---|
Content-Type |
The media type of the body of the request. This is required for POST and PUT requests. |
|
Authorization |
The type of authorization. The REST API for AI and ML services uses the OAuth 2.0 bearer token framework. |
where |
Accept |
The media types that the client wants to receive in the response. |
|
Host |
The domain name (and optionally the port number) of the server to which the request is being sent. |
|
Swagger URL
If you use Swagger, you can make calls to the API for AI and ML services at this URL:
apiRoot/openapi/ui/index.html