邮递员职位未发送任何数据

时间:2018-08-07 00:50:20

标签: php post postman

我正在使用Postman测试api,但是它不发送任何数据。

当我使用php函数创建测试时,效果很好。

api php

$json_str = file_get_contents("php://input");
$obj = json_decode($json_str, false);

测试php

$obj->CompanyCode= "39170";
$obj->CustomerNumber= "1800001";
$options = array(
 'http' => array(
   'method'  => 'POST',
   'content' => json_encode( $obj ),
'header'=>array(
               "Content-Type: application/json", 
               "Accept: application/json")
)
);

$context  = stream_context_create( $options );
$result = file_get_contents( "https://www.url.com/inquiry/", false, $context );

邮递员

postman header

postman body

0 个答案:

没有答案
相关问题