Browse Source

Define default content type

Cerothen 9 years ago
parent
commit
ca3fcff88f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      functions.php

+ 1 - 1
functions.php

@@ -239,7 +239,7 @@ function curl_post($url, $data, $headers = array(), $referer='') {
 	curl_setopt($curlReq, CURLOPT_CUSTOMREQUEST, "POST"); 
 	curl_setopt($curlReq, CURLOPT_CUSTOMREQUEST, "POST"); 
 	curl_setopt($curlReq, CURLOPT_RETURNTRANSFER, true);
 	curl_setopt($curlReq, CURLOPT_RETURNTRANSFER, true);
 	// Format Data
 	// Format Data
-	switch ($headers['Content-Type']) {
+	switch (isset($headers['Content-Type'])?$headers['Content-Type']:'') {
 		case 'application/json': 
 		case 'application/json': 
 			curl_setopt($curlReq, CURLOPT_POSTFIELDS, json_encode($data));
 			curl_setopt($curlReq, CURLOPT_POSTFIELDS, json_encode($data));
 			break;
 			break;