I have a Magento observer that I want to use some curl with - essentially I want to use the very same request as the jQuery AJAX call below but convert this into a cURL event within my observer function.
$('#org_search_term').autocomplete({
serviceUrl: '<?php echo $this->getUrl('rp/organisation/search', array('_secure' => true)) ?>',
paramName:'term',
minChars: 3,
deferRequestBy: 500,
dataType: 'json',
transformResult: function (response) {
var results = { suggestions:[] };
if (!response.totalRecords)
return false;
$.each(response.items, function(i, item){
results.suggestions.push({
value: item.organisation_name+', '+item.street+', '+item.town+', '+item.county+', '+item.postcode+', '+item.country,
data: item.organisation_id
});
});
return results;
}
});