注: これは、Roblox の Lua のバージョンです。
JSONEncoded テーブルを Pastebin にアップロードする方法を考えています。開発キー、ユーザー名、およびパスワードを使用して PostAsync を送信し、ログイン セッション キーを使用して Pastebin からの応答を待機することにより、ログイン セッション キーを取得する必要があると表示されます。これまでの私のコードは次のとおりです。
h = game:GetService'HttpService'
pasteData = h:UrlEncode(h:JSONEncode(ImgScript))
username = 'USERNAMEHERE'
password = 'PASSWORDHERE'
h:PostAsync(
'http://pastebin.com/api/api_login.php',
'api_dev_key=DEVKEYHERE&api_user_name=' .. h:UrlEncode(username) .. '&api_user_password=' .. h:UrlEncode(password),
2
)
api_user_key = GeneratedUserKeyHere --THIS is what I am after; I don't know how to wait for a response from Pastebin to get this key!
h:PostAsync(
'http://pastebin.com/api/api_post.php',
'api_dev_key=' .. api_dev_key .. 'api_option=paste&api_user_key=' .. api_user_key .. '&api_paste_private=1&api_paste_expire_date=N&api_paste_format=lua&api_paste_code=' .. h:UrlEncode(h:JSONEncode(ImgScript)) --ImgScript is the table,
2
)