When I want to request my own http server, rclone lsjson return ERROR : : error listing: error listing "": can't parse content type "application/json"

What is the problem you are having with rclone?

I want to setup a transit service to control the file what I can see, then my server will connect to the real cloud storage, because some files in storage do not need to be displayed.
When I want to request my own http server, rclone lsjson return ERROR : : error listing: error listing "": can't parse content type "application/json"

Run the command 'rclone version' and share the full output of the command.

rclone v1.58.0

  • os/version: Microsoft Windows 11 Home 23H2 (64 bit)
  • os/kernel: 10.0.22631.3593 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.17.8
  • go/linking: dynamic
  • go/tags: cmount

Which cloud storage system are you using? (eg Google Drive)

I use the Http type to connect my server

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone lsjson mocks33:

and return [
ERROR : : error listing: error listing "": can't parse content type "application/json"
Failed to lsjson with 2 errors: last error was: error in ListJSON: error listing "": can't parse content type "application/json"

A log from the command that you were trying to run with the -vv flag

/: Dir.Stat error: error listing "": can't parse content type "application/json"
ERROR : IO error: error listing "": can't parse content type "application/json"

What I want to ask for help is : When I click on the vdisk, what format should I give rclone to return so that it displays the file directory I want?
I tried to return:
directory_contents = [
{
"Name": "Documents",
"Path": "Documents",
"Size": 4096,
"ModTime": "2023-04-01T12:00:00Z",
"IsDir": True,
"ItemType": "dir"
},
{
"Name": "image.jpg",
"Path": "image.jpg",
"Size": 1024000,
"ModTime": "2023-04-15T10:30:00Z",
"IsDir": False,
"ItemType": "file"
},
{
"Name": "report.pdf",
"Path": "report.pdf",
"Size": 2048000,
"ModTime": "2023-05-01T15:00:00Z",
"IsDir": False,
"ItemType": "file"
}
]
response = make_response(jsonify(directory_contents))
response.headers["Content-Type"] = "application/json"
return response
But it doesn't work... Thanks for anyhelp, and welcome any other way to fulfill my needs.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.