此资源不支持请求实体的媒体类型“multipart/form-data”。\",\"ExceptionMessage\"unsure emoticon"没有 MediaTypeFormatter 可用于从媒体类型为“multipart”的内容中读取“SmsQueue”类型的对象/form-data'.\",\"ExceptionType\"unsure emoticon"System.Net.Http.UnsupportedMediaTypeException\",\"StackTrace\"unsure emoticon" at System.Net.Http.HttpContentExtensions.ReadAsAsync[T](HttpContent content, Type type, IEnumerable 1 formatters, IFormatterLogger formatterLogger, CancellationToken cancelToken)\r\n at System.Web.Http.ModelBinding.FormatterParameterBinding.ReadContentAsync(HttpRequestMessage request, Type type, IEnumerable`1 formatters, IFormatterLogger formatterLogger,CancellationToken cancelToken)\"}"
// Prepare you post parameters
$postArray = array(
'APIKey' => AUTH_KEY,
'number' => $mobile,
'text' => $message,
'senderid' => SENDER_ID,
'channel' => $channel,
'DCS' => $DCS,
'flashsms' => $flashsms,
'route' => $route
);
// Init the resource
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $postArray
));
// Ignore SSL certificate verification
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
// Get response
$curlOutput = curl_exec($ch);
// Print error if any
if (curl_errno($ch)) {
echo 'error:' . curl_error($ch);
}
curl_close($ch);