我正在为回调编写一个PHP Codeigniter代码,我应该得到一个json响应,但是当我的合作伙伴应该对该回调API进行反序列化时,他们在.net(C#)上工作时它们正在获取XML。响应,但是无论我在哪里尝试使用浏览器或邮递员,我都只会得到JSON。怎么会发生
我的PHP代码标识符
header("Content-type: application/json");
$Txntype = $_GET['Txntype'];
$Timestamp = $_GET['Timestamp'];
$Bcid = $_GET['BcId'];
$Terminalid = $_GET['TerminalId'];
$transactionID = $_GET['TransactionId'];
$Amount = $_GET['Amount'];
$txnStatus = $_GET['TxnStatus'];
$BankIIN = $_GET['BankIIN'];
$TxnMedium = $_GET['TxnMedium'];
$EndCustMobile = $_GET['EndCustMobile'];
$usertransactionId = mt_rand(111111,999999);
$outletdetail = " match bc id in table" ;
$userid = '123';
if($outletdetail != '')
$MESSAGE = "Success";
$array1 = array('STATUS'=>'SUCCESS','VENDOR_ID'=>12345,'TRANSACTION_ID'=>$usertransactionId,'MESSAGE'=>$MESSAGE);
}else{
$MESSAGE = "Failure";
$array1 = array('STATUS'=>'FAILED','VENDOR_ID'=>$transactionID,'TRANSACTION_ID'=>$usertransactionId,'MESSAGE'=>$MESSAGE);
$table1='kp_aeps_checkstatus';
$data=$this->Finacial_model->magagram_aeps_checkstatus_insert_data($array1,$table1);
}
return $this->response($array1);
}
我的JSON响应 在邮递员或浏览器中测试
{
"STATUS": "SUCCESS",
"VENDOR_ID": 12345,
"TRANSACTION_ID": 611966,
"MESSAGE": "Success"
}
但是,当他们在.net(C#)中反序列化时,它们会收到这样的响应RESPONSE 我身边是否有任何错误,因为每个人的代码都在工作,但是当我发送的代码不起作用时,我尝试使用另一个人的代码,该人的代码成功反序列化,但我无法获取它