Forum Discussion

Descaii's avatar
Descaii
Explorer | Level 3
8 years ago

HTTP/1.1 301 Moved Permanantly error

-- 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?

1 Reply

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    I can't offer help with lua itself, but it looks like you may not have it configured to actually use https and so it's falling back to http. Dropbox API calls requires https though, so it is redirecting you to https.

    It looks like there's more information about configuring https support in lua here:

    https://stackoverflow.com/questions/8286677/https-request-in-lua

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!