HttpService Question

After HttpService:PostAsync, a new post appears on pastebin. How to get data from this post from another script without a link?

How to read post from another script without any links.

when the first script posts something to pastebin

it should also set what it posted in a

then the seconds script can use
to detect when the first script posted something to read the value that was posted

What if the other script is on a different server.

im not sure what kind of data your trying to send but cant you send the data using

here is how to use MessagingService

@5uphi’s solution works fine if it’s within the same experience (game/server). For this, you’ll need to use a GET request, which would look like this:

local urlOf = ""
local pastebinId = ...

local function getPastebinCode()
    local data
    local success, errMessage = pcall(
            data = HttpService:GetAsync(urlOf:format(pastebindId))
            if #data > 0 then
                data = HttpService:JSONDecode(data)

    if success then
        return data

If it worked, mark it as the solution. :+1:

pastebindId is “”?

And is it possible to read the post knowing only dev_key?
or no. If no your answer will be the solution.

Completely! When you create the post and you store the data in return from the PostAsync request, you’ll be storing the id, I would say to use a Signal to store such thing and use some string pattern to find the numbers within the string, It would be too complicated but something like this could work perfectly fine:

-- post script
local dataInReturn = HttpService:PostAsync(...) -- your request to post a pastebin

And then…

-- get script
local pastebinUrls = {}
local event = ... -- the signal event

        table.insert(pastebinUrls, urlToStore)

local function getId(pastebinUrl)
    return string.match(pastebinUrl, "%d+")

This is just a bit more complicated example, but this is how I would do it. :+1:

This is not possible, since the script won’t know which script to look at! You could have 6 pastebin but, what script should your program get? That’s why you need the ID as it is the unique identifier for it.

Thanks for the help. You helped solve my problem.

1 Like

And yes, I understand that you can not change the pastebin post.