Skip to content

Cannot create JSON files #1011

Description

@boulderwebdev

If I try to POST or PUT a JSON file using solid.auth.fetch then an empty file is stored on the server. For example, I could call

const data = JSON.stringify({
  "hello": "world"
})
const url = 'https://boulderwebdev.solid.community/public/'
solid.auth.fetch(url, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Slug": "data",
    "Content-Length": data.length
  },
  body: data
}).then((resp) => {  ... })

and the server will create a file and respond with

201
allow OPTIONS, HEAD, GET, PATCH, POST, PUT, DELETE
content-length 7
content-type text/plain; charset=utf-8
etag W/"7-rM9AyJuqT6iOan/xHh+AW+7K/T8"
link <.acl>; rel="acl", <.meta>; rel="describedBy", <http://www.w3.org/ns/ldp#Container>; rel="type", <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"
location /public/data.json
vary Accept, Authorization, Origin

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions