Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php脚本引发错误的请求错误_Php_Curl - Fatal编程技术网

Php脚本引发错误的请求错误

Php脚本引发错误的请求错误,php,curl,Php,Curl,我正在使用此代码使用Fowiz发送消息,但这会引发错误的请求错误,但不会显示400。请提供任何帮助 <?php $mypasscode = 'your passcode'; $my_username = 'your fowiz username'; $to_phone_number = 'recipient phone number'; $my_message = 'your message'; $c

我正在使用此代码使用Fowiz发送消息,但这会引发错误的请求错误,但不会显示400。请提供任何帮助

<?php
        $mypasscode = 'your passcode';
        $my_username = 'your fowiz username';    
        $to_phone_number = 'recipient phone number';
        $my_message = 'your message';

        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, 
            "http://cloud.fowiz.com/api/message_http_api.php");
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(
            'username' => $my_username,
            'phonenumber' => $to_phone_number,
            'message' => $my_message,
            'passcode' => $my_passcode,
        ), '', '&'));        

        $result = curl_exec($curl);    
        $error = curl_error($curl);    
        curl_close($curl);    

        echo $result;
    ?>


Bad request(错误请求)表示您缺少一个参数或身份验证出错,但所有凭据均为PERFECTBAD request(错误请求)表示您缺少一个参数或身份验证出错,但所有凭据均为PERFECT(错误)