Relative Links with IBM Cloud API Gateway

I work quite a bit with serverless tech, particularly on IBM Cloud since I work there. At the moment I’m building a microservice using web actions. When a user creates data with a POST request, I want to redirect them to the URL of the new thing they created – but for that I need to know the URL that it was accessed with. This is a relatively new feature on API Gateway so here’s a quick howto for grabbing that URL in both JavaScript and PHP. Continue reading