01 | local httpService = Game:GetService( "HttpService" ); |
02 | local url = "https://code.stypi.com/8vi0ntes" |
03 | local body = "rbxVar=" .. httpService:UrlEncode( "lel roblux" ) |
04 | httpService:PostAsync(url, body, Enum.HttpContentType.ApplicationUrlEncoded) |
05 |
06 |
07 |
08 | its giveing a |
09 | 07 : 11 : 23.585 - Error response: |
10 | 07 : 11 : 23.587 - HTTP 403 (Forbidden) |
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:
1 | --Simple Example of a GET request sent to example.com |
2 | hs = game:GetService( "HttpService" ) |
3 | test = hs:GetAsync( "http://example.com" , true ) |
4 | -- test now contains the html text representation of example.com. |
PostAsync
1 | string PostAsync ( |
2 | string url, |
3 | string data, |
4 | HttpContentType content_type = ApplicationJson |
5 | ) |
Watch this for more help: http://m.youtube.com/watch?v=4u4pq_8muck