nodeSolidServer / nodeSolidServer/node-solid-server

PUT Requests storing empty JSON object

Open
#1,165 12 comments 0 reactions 1 assignee View on GitHub

@jaxoncreed is already working on this.

Since Apr 24, 2019.

test-case
Dominant language
JavaScript
Stars
1.8k
Forks
308
PR merge metrics
No merged PRs in 30d

Description

I am trying to update text files on my pod using a PUT request. If I have a text file, e.g. /public/hello.txt and make a PUT request to override its value, the file is replaced by a text file with an empty JSON object.

Here's a snipped of the code I used to perform the PUT request. Here we are assuming /public/hello.txt exists already.

url = "https://boulderwebdev.solid.community/public/hello.txt"
solid.fetch(url, {
  method: "PUT",
  headers: {
    "Content-Type": "text/plain"
  },
  body: JSON.stringify({"hello": "world"})
}).then(resp => {...})

If you go to https://boulderwebdev.solid.community/public/hello.txt now you will see a page with the text

{}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.