public function curl_request($url, $method, $postvals)
{
$ch = curl_init($url);
if ($method == "POST") {
$options = array(CURLOPT_POST => 1, CURLOPT_POSTFIELDS => $postvals, CURLOPT_RETURNTRANSFER => 1);
} else {
$options = array(CURLOPT_RETURNTRANSFER => 1);
}
curl_setopt_array($ch, $options);
if ($this->header) {
curl_setopt($ch, CURLOPT_HTTPHEADER, array($this->header . $postvals));
}
$response = curl_exec($ch);
curl_close($ch);
# print_r($response);
return $response;
}