This error occurs when an API script uses a malformed URL, often due to specifying a relative path instead of a full (absolute) URL.
To resolve this issue, update your API script to use the complete URL, including the protocol (e.g., https://), domain, and path.
https://yourdomain.com/path/to/api
Switching from relative links to full URLs should eliminate the error.