1

我正在尝试在 LUA 中编写一个函数来编辑我的 pastebin 代码。

我可以使用此代码发布 HTTP 帖子:

http.post(string url, string postData [, table headers])

我还可以将此代码用于 HTTP 获取:

http.get(字符串 url [, 表头])

Pastebin 网站https://pastebin.com/api上有关于使用 API 的信息。我不确定,如果这个网站可以帮助我解决我的问题。

有人知道如何填写标题表吗?

这是我试过的程序:

headers = {}
headers["api_dev_key"]= 'myDevKey...'; // your api_developer_key
headers["api_paste_code"]   = 'my edited text'; // your paste text
headers["api_paste_private"] = '0'; // 0=public 1=unlisted 2=private
headers["api_paste_name"] = 'justmyfilename.php'; // name or title of your paste
headers["api_paste_expire_date"] = '10M';
headers["api_paste_format"] = 'php';
headers["api_user_key"] = ''; // if an invalid or expired api_user_key is used, an error will spawn. If no api_user_key is used, a guest paste will be created
headers["api_paste_name"] = myPastebinName;
headers["api_paste_code"] = myPastebinPassword;
http.get("https://pastebin.com/edit/dQMDfbkM", headers)

不幸的是,这不起作用,并且在 pastebin API 帮助站点上没有用于编辑粘贴的示例。只是为了创造一个新的。

对我来说,我是否必须使用 post 或 get 也不清楚

4

1 回答 1

7

没有用于直接编辑粘贴的 API。

您只能删除旧粘贴并使用更新的文本创建新粘贴。

于 2018-01-19T06:28:43.167 回答