-- code written in lua
local http = require("socket.http")
local ltn12 = require("ltn12")
local json = require("json")
local url = "https://api.dropboxapi.com"
local data = {}
local request = {http.request{
url=url,
path = "/2/files/list_folder",
method="POST",
sink = ltn12.sink.table(data),
headers = {
["Content-Type"] = "application/json",
["Authorization"] = "Bearer -secret code"
},
source = ltn12.source.string(json.encode{
path = "",
shared_link = {
url = "secret link"
}
})
}}
stuff["data"]=data
require("Parse")(request)
I'm attempting to use a folder for a web library for my personal projects, but I can't get the HTTP request to work properly. I've tried many things, but it always returns with the Moved Permanantly error. Anyone have an idea of what's wrong?