Common patterns with Solid

Zwifi
1,769 views

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

An introduction to solid common patterns

This interactive tutorial is meant to be used as a complement to the solid developer documentation.

Reading from a public resource

Let's start out with the simplest possible interaction with a solid server: reading a public resource.

A public resource can be accessed without authentication, so it's basically like any resource on the web: a GET on the IRI, and you're good to go.

I wonder what Cleopatra shared in her blog.
const axios = require("axios");
// You can change the host and resource to match something from
// your own pod if you want
const host = "https://cleopatra.solid.community"
const resource = "/public/blog/religion/greek-egyptian-conandrum.txt"
const url = host+resource;
axios.get(url)
.then(response => {
// Let us just display the content of the resource
console.log(response.data);
})
.catch(error => {
console.log(error);
})
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content