I have an HTTP POST that is generated by a Shopify page I created. I need to access the POST data from the liquid page. Is this possible? It seems like there should be some handle for this. It seems rather obvious, but I cannot find any documentation on this. Is it possible?
Solved! Go to the solution
This is an accepted solution.
Liquid is not a server side processing language like PHP it is a simple safe template language.
Thus self defined url parameters are not supported in liquid for themes.
For the various url parameters that are used by shopify, they are used to generate the data then rendered in the view.
So what you can access depends on the object like the selected variant, or the current vendor or search terms, etc
It would be helpful if there was a Liquid object with the POST data
Again shopify is not like running a PHP or ruby server and that would be a major increase i
Such data is highly dynamic allowing access to parameters would undermine shopify's ability to scale with aggressive cache'ing for pages.
there are known security issues with GET
Processing dynamic fields defined by end-users is an even bigger known security issue
How about some subset of data? Something like a key value pair that can be accessed through a Liquid object
Technically the querystring itself is exposed in the content_for_header but you'd have to strip it out and that usage is not supported and the cache is involved.
Each one comes with different behaviors and caveats, test thoroughly.
There are also alternate templates using the ?view= parameter
and a dynamically created token over GET
Is this for the storefront api? or an app? if an app a consider a proxy