Fetch in JS, any ideas how?

Hi, I’m looking to modify some LD in my profile as a learning exercise, does anyone know the required fetch api request headers I need to add to my JS call to make it work from my local non-pod web server page where I am already successfully logged in?

The fomat i’m looking to use is…

fetch(“https://someone.inrupt.net/profile/card#me”, {
method: “patch”,
headers: {
“Content-Type”: “application/sparql-update”,
// ?
},
// ?
credentials: “include”,
// ?
body: “DELETE DATA { https://someone.inrupt.net/profile/card#me http://www.w3.org/2006/vcard/ns#role “Clown” . } ; INSERT DATA { https://someone.inrupt.net/profile/card#me http://www.w3.org/2006/vcard/ns#role “Juggler” . }”,
})

Use solid-auth-client’s implementation of fetch. Your options are okay, you’re just missing the authorization header (solid-auth will generate and add it to the request itself though).

1 Like

Hi, thanks you your response, I didn’t really want to use solid-auth for this learning exercise.