Lasso Soft Inc. > Home

[ curl_easy_getinfo ]

Method

[curl_easy_getinfo] extracts information from a [curltoken].

Request internal information from the curl session with this method. The second parameter is one of the libcurl methods starting with curlinfo_.
  • Syntax
curl_easy_getinfo('curltoken', 'curlinfo option')
Examples
  • Intermediate

To obtain the status code for a URL

Code

local(ctoken, err, data, headerBytes = bytes, bodyBytes = bytes, ready = false)
#ctoken = curl_easy_init
#err = curl_easy_setopt(#ctoken, curlopt_url, "http://www.lassosoft.com/")
while(!#ready) => {
     #data = curl_multi_perform(#ctoken)
     #data->second->isa(::bytes) ? #headerBytes->append(#data->second)
     #data->last->isa(::bytes) ? #bodyBytes->append(#data->last)
     #ready = !#data->first
     !#ready ? sleep(10)
}
//#headerBytes contains the http headers returned
//#bodyBytes contains the data returned from the request

curl_easy_getinfo(#ctoken, curlinfo_response_code)

Result

200

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft