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

Help with http :l?

Asked by 9 years ago
local httpService = Game:GetService("HttpService");
local url = "https://code.stypi.com/8vi0ntes"
local body = "rbxVar=" .. httpService:UrlEncode("lel roblux")
httpService:PostAsync(url, body, Enum.HttpContentType.ApplicationUrlEncoded)



its giveing a
 07:11:23.585 - Error response:  
07:11:23.587 - HTTP 403 (Forbidden)


0
Are you sure this output is directly related to your script? If so, have you enabled HttpService? Muoshuu 580 — 9y
0
yes and yes xXUltraAltraXx 20 — 9y
0
Stypi is broken, plus you cant use postasync on stypi; postasync would work with github,pastebin.. but pastebin you will have to use A LOT more code to post. MessorAdmin 598 — 9y

1 answer

Log in to vote
1
Answered by
iFlusters 355 Moderation Voter
9 years ago

Turning on HttpService is quite easy. In ROBLOX Studio, look at your top menu bar. Press Insert -> Service -> HttpService. Once you locate HttpService under the Explorer window, find HttpEnabled under Properties. Set this to true (check the box).

Here's example on how to use it in a script:

--Simple Example of a GET request sent to example.com
hs = game:GetService("HttpService")
test = hs:GetAsync("http://example.com", true)
-- test now contains the html text representation of example.com.

PostAsync

string PostAsync (
    string url,
    string data,
    HttpContentType content_type = ApplicationJson
)

Watch this for more help: http://m.youtube.com/watch?v=4u4pq_8muck

0
im trying to post not get xXUltraAltraXx 20 — 9y
0
Ah, sorry. iFlusters 355 — 9y
0
Edited my answer. iFlusters 355 — 9y
Ad

Answer this question