Modules/cURL/curl init: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Modules/cURL/func_page| | {{Modules/cURL/func_page| | ||
description = Initialize the curl engine.| | description = Initialize the curl engine.| | ||
syntax = <syntaxhighlight lang="lua">curl | syntax = <syntaxhighlight lang="lua">curl curlInit([string url])</syntaxhighlight>| | ||
required_arguments = *There are no required arguments.| | required_arguments = *There are no required arguments.| | ||
optional_arguments = * '''url''' The url which you want to connect too.| | optional_arguments = * '''url''' The url which you want to connect too.| | ||
returns = A valid curl handler on succes, otherwise it returns false| | returns = A valid curl handler on succes, otherwise it returns false| | ||
example = <syntaxhighlight lang="lua"> | example = <syntaxhighlight lang="lua"> | ||
curl = | curl = curlInit("http://mtasa.com/"); | ||
if not curl then | if not curl then | ||
outputDebugString("Can't connect to http://mtasa.com/ with cURL"); | outputDebugString("Can't connect to http://mtasa.com/ with cURL"); |
Latest revision as of 11:06, 22 June 2014
This function is provided by the external module cURL. You must install this module to use this function. | |
Initialize the curl engine.
Syntax
curl curlInit([string url])
Required arguments
- There are no required arguments.
Optional arguments
- url The url which you want to connect too.
Returns
A valid curl handler on succes, otherwise it returns false
Example
curl = curlInit("http://mtasa.com/"); if not curl then outputDebugString("Can't connect to http://mtasa.com/ with cURL"); else -- lets do something here. end