Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Http 通过API编辑现有的Pastebin文档_Http_Lua_Pastebin - Fatal编程技术网

Http 通过API编辑现有的Pastebin文档

Http 通过API编辑现有的Pastebin文档,http,lua,pastebin,Http,Lua,Pastebin,我正在尝试用LUA编写一个函数来编辑我的pastebin代码 我可以使用以下代码制作HTTP post: http.post(字符串url,字符串postData[,表头]) 我还可以将此代码用于HTTP get: get(字符串url[,表头]) 在Pastebin网站上有关于使用API的信息。 我不确定,如果这个网站可以帮助我解决我的问题 有人知道如何填写标题表吗 这是我尝试的程序: headers = {} headers["api_dev_key"]= 'myDevKey...'; //

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

我可以使用以下代码制作HTTP post:

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

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

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

在Pastebin网站上有关于使用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帮助站点上没有用于编辑粘贴的exsample。只是为了创造一个新的


对我来说,还不清楚是否必须使用post或get,因为没有直接编辑粘贴的API


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

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


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

我不能相信,因为我认为,浏览器也只是使用HTTP,而使用浏览器仍然是可能的。我只需要正确填写表格。。。但是谢谢你的回复。在我投票决定这个答案之前,我先等一等,再试一次again@Thomas浏览器不使用API。当然,您可以模拟浏览器行为,但这并不容易。我发现使用API的JavaScript模块可以像浏览器一样编辑粘贴:()。您可以尝试重新实现编辑Lua粘贴的部分代码…如果pastebin无法实现,是否有其他粘贴服务允许通过HTTP API编辑现有粘贴?@frakman1 Github Gists-它们基本上只是Github回购,您可以使用本地Github推送它们,我无法相信,因为我认为,浏览器也只是使用HTTP,使用浏览器仍然是可能的。我只需要正确填写表格。。。但是谢谢你的回复。在我投票决定这个答案之前,我先等一等,再试一次again@Thomas浏览器不使用API。当然,您可以模拟浏览器行为,但这并不容易。我发现使用API的JavaScript模块可以像浏览器一样编辑粘贴:()。您可以尝试重新实现编辑粘贴到Lua的部分代码…如果无法使用pastebin,是否有其他粘贴服务允许通过HTTP API编辑现有粘贴?@frakman1 Github Gists-它们基本上只是Github repo,您可以使用本地git推送它们