Header type processing
This commit is contained in:
		@@ -33,14 +33,14 @@ class curl {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static function request($url, $data) {
 | 
			
		||||
        $ch = curl_init($url);
 | 
			
		||||
    public static function request($callback, $data) {
 | 
			
		||||
        $ch = curl_init($callback->url);
 | 
			
		||||
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
 | 
			
		||||
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
 | 
			
		||||
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 | 
			
		||||
        curl_setopt($ch, CURLOPT_HTTPHEADER,
 | 
			
		||||
            array(
 | 
			
		||||
                "Content-Type: application/json",
 | 
			
		||||
                "Content-Type: application/" . $callback->type,
 | 
			
		||||
                "Content-Length: " . strlen($data))
 | 
			
		||||
            );
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -98,7 +98,7 @@ class events {
 | 
			
		||||
    private static function send($data, $callback) {
 | 
			
		||||
        $curl = new curl();
 | 
			
		||||
        $package = self::packup($data);
 | 
			
		||||
        $curl::request($callback->url, $package);
 | 
			
		||||
        $curl::request($callback, $package);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user