Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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);
})
Enter to Rename, Shift+Enter to Preview
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content