0
votes

For the shopify application proxy, you are supposed to set the response to Content-Type: application/liquid, as explained here.

I am using Laravel, but even trying a basic php example, the browser will only download the response, it will not display it.

<?php

header('Content-Type: application/liquid');

echo "test";

Even just that will download a file with the contents "test".

I've tried .htaccess changes, and those do not work.

Thank you.

1

1 Answers

0
votes

When you make a request to the endpoint, the proxy returns that desired content (Liquid or JSON or vanilla HTML). It is up to you to decide where to display it in DOM. Since you know where you want to display your response, you can use Javascript to pinpoint a DOM node to replace, and replace it.

The proxy pattern has no magic with the response that makes it suddenly visible. If the response has Liquid tags in it, Shopify will fill those in as best it can, meaning the big string of HTML you get back from the Proxy, is ready to be glued into DOM.