Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

HTTP method post only works once before having to reopen Roblox Studio, is this my fault?

Asked by 5 years ago

So I was bored and I was wondering if there were any Snapchat usernames that were a common word left to claim. Here is the code:

01http = game:GetService("HttpService")
02names = {"hello"}
03username = ""
04function req()
05    local response = http:RequestAsync({
06    Headers = {
07                Accept = "*/*",
08                ["Accept-Language"] = "en-US,en;q=0.5",
09                Referer = "https://accounts.snapchat.com/",
10                Cookie = "xsrf_token=PlEcin8s5H600toD4Swngg; sc-cookies-accepted=true; web_client_id=b1e4a3c7-4a38-4c1a-9996-2c4f24f7f956; oauth_client_id=c2Nhbg==",
11                ["Content-Type"] = "application/x-www-form-urlencoded; charset=utf-8",
12            },
13    Method = "POST",
14    Url = "https://accounts.snapchat.com/accounts/get_username_suggestions?requested_username="..username.."&xsrf_token=PlEcin8s5H600toD4Swngg",
15    Body = username
View all 42 lines...

I was testing if it even worked so that's why I don't have a list of words to read yet. Anyway, the code worked only for one word and it never worked again. Even if I reran the script through the command bar it still wouldn't work. The only way I was able to make it work was from closing and reopening Studio. The error that it sent was HTTP 405 Method Not Allowed, HTTP method POST is not supported by this url. This is weird because the first time I used POST it worked, but the second time it didn't. This could be a problem with my code, the website, or Roblox but I'm not sure, any help would be appreciated.

Answer this question