dongqiuwei8667 2018-02-19 05:26
浏览 49

无法获取php中的原始请求的响应[重复]

This question already has an answer here:

Hi for this great community. I'm new ones to create api's in php. The problem is I'm not able to get the response when i send the raw request from the postman.Here is my code for raw_request_api.php

<?php
if(isset($_REQUEST['json'])) {
    $jsonobj = $_REQUEST['json'];
    $json = json_decode($jsonobj);
    echo json_encode($json);
}else
    echo "Unable to get the request data";

?>  

I'm getting the response when I use Form data as well as x-www-form-urlencoded. form-data

x-www-form-urlencoded.

But I'm not able to get the response from the raw data. enter image description here Please help me where i'm making the mistake? Also I tried every format for raw data...like text/html, application/json, application/xml, text/xml...nothing works

</div>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 DIFY API Endpoint 问题。
    • ¥20 sub地址DHCP问题
    • ¥15 delta降尺度计算的一些细节,有偿
    • ¥15 Arduino红外遥控代码有问题
    • ¥15 数值计算离散正交多项式
    • ¥30 数值计算均差系数编程
    • ¥15 redis-full-check比较 两个集群的数据出错
    • ¥15 Matlab编程问题
    • ¥15 训练的多模态特征融合模型准确度很低怎么办
    • ¥15 kylin启动报错log4j类冲突