Goto main content

curl_easy

This function is used to request a url.

CURL_EASY

NAME

curl_easy - This function is used to request a url.

SYNOPSIS

curl_easy(url:"…",error:true|false,timeout:30,followlocation:true|false)

DESCRIPTION

curl_easy is used to send a request to a url and get the answer back. It's best for making simple curl requests that don't require passing data or parameters.

PARAMETERS

url
Mandatory. The url of the request.
error
If an error occur, and this parameter is true, than an error will occured.
If this prameter is false, than the return associative array will have the variable error set to true with the variable message set with the error message.
timeout
How much time we wait for the request.
followlocation
If followlocation is true(which is the default) it tells the library to follow any Location: header that the server sends as part of an HTTP header.

RETURN

A context with the following info:
error : true or false
message : error
message if any
body : body of the request
header : header of the request

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

res={_{ r = curl_easy(url:"http://v5.sednove.ca/curl1.sn", timeout: 30); r.body}}. return Test 1 de curl

SEE ALSO

AUTHOR

Written by Pierre Laplante, <laplante@sednove.com>

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.