Skip to main content

Test API Communication

Purpose: An internal test method to verify that the API is properly deployed and working properly on Kong API Gateway

Explanation:

  • If the external call API URL is https://domain.com/basePath/apiPath, it is a combination of the following configurations:
    • Protocol: HTTPS
    • Host: domain.com
    • Base Path: /basePath
    • Sub Path: /apiPath
Four typical call errors:
  • When the external domain is not registered with the DNS server or is incorrect.
  • When BasePath is incorrect.
{
message: "no Route matched with those values"
}
  • When Backend URL is incorrect.
{
message: "name resolution failed"
}
  • The backend application does not start normally.
{
message: "An invalid response was received from the upstream server"
}
  • Other Context: Check web browser > developer tools

  • How to check if your API is successfully deployed to Kong API Gateway
# Accessing Kong API Gateway (Any pod can access it as long as it is running in the same cluster as theKong Gateway and supports curl)
kubectl -n apim-dev exec --it {gateway pod name} -c fluent-bit /bin/bash

# Enter Base Path, Sub Path for validation on Port 80 for Kong API Gateway API proxy
# Enter actual business domain in Header Host
# How to test as if you were communicating with a real business domain
curl -i -k http://{Kong-Service-Name}.{Kong-Namespace}:80/basePath/apiPath -H "Host: domain.com"