HttpGet (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>ArceusInator
example
Fix minor code syntax error - missing double parentheses
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Locked}}
{{Locked}}
<onlyinclude>{{Method|name = HttpGet
<onlyinclude>{{Method
|arguments = [[string]] ''URL''
|name = HttpGet
|arguments = [[string]] ''URI''[, [[bool]] ''synchronous'']
|returns = [[string]] ''request body''
|returns = [[string]] ''request body''
|description = Retrieves HTML of the URI via get variable method.
|description = Retrieves HTML of the URI via get variable method.
|object = DataModel
|object = DataModel
|protected = yes
}}</onlyinclude>
}}</onlyinclude>


{{clear floats}}


{{Example|
-- Correct security context will allow you to get variables from an HTML document.
print(game:HttpGet("<nowiki>ht</nowiki>tp://somesite/", true)); -->  However, in Roblox, only external  code is allowed to call this, so you will get an error saying "s HttpGet"
}}


{{Example|
If using the [[Command Bar]] or a [[CoreScript]]...<pre>
print( game:HttpGet( "http://www.roblox.com/User.aspx?ID=4812582" ) ) --> s HttpGet</pre>
If using a [[Script]] or a [[LocalScript]]...<pre>
print( game:HttpGet( "http://www.roblox.com/User.aspx?ID=4812582" ) ) --> s HttpGet</pre>}}
[[Category:Methods]]
[[Category:Methods]]

Latest revision as of 02:31, 19 February 2023

Protected:This item is protected. Attempting to use it in a Script or LocalScript will cause an error.
HttpGet( string URI[, bool synchronous] )
Returns string request body
Description: Retrieves HTML of the URI via get variable method.
Member of: DataModel


Example
-- Correct security context will allow you to get variables from an HTML document.

print(game:HttpGet("http://somesite/", true)); -->  However, in Roblox, only external  code is allowed to call this, so you will get an error saying "s HttpGet"