L
L
LiquidApps Documentation
Search…
⌃K

Example GET Static Web Page

const result = await storageClient.upload_public_file(
data,
key,
permission,
options
);
// fetch data back from liquidstorage using a GET request and set response headers for 'Content-Type'
// and 'cross origin isolation' (check out: https://web.dev/coop-coep/ for more information!)
let url_params = '?uri=' + result.uri;
url_params += '&__content_type=text%2Fhtml%3B%20charset%3Dutf-8';
url_params += '&__cross_origin_opener_policy=same-origin';
url_params += '&__cross_origin_embedder_policy=require-corp';
res = await fetch(endpoint + '/v1/dsp/liquidstorag/get_uri' + url_params, {
method: 'GET',
mode: 'cors'
});
So you fetch the URI, add your GET URL params and cors settings and fetch and modern browsers accept it.