其他分享
首页 > 其他分享> > laravel JsonResponse获取返回的json信息

laravel JsonResponse获取返回的json信息

作者:互联网

返回信息:

JsonResponse {#303
  #data: "{"status_code":200,"message":"success","data":{"yh_code":"YH605BEA88E8605","yh_money":null}}"
  #callback: null
  #encodingOptions: 0
  +headers: ResponseHeaderBag {#289
    #computedCacheControl: array:2 [
      "no-cache" => true
      "private" => true
    ]
    #cookies: []
    #headerNames: array:3 [
      "cache-control" => "Cache-Control"
      "date" => "Date"
      "content-type" => "Content-Type"
    ]
    #headers: array:3 [
      "cache-control" => array:1 [
        0 => "no-cache, private"
      ]
      "date" => array:1 [
        0 => "Thu, 25 Mar 2021 01:47:35 GMT"
      ]
      "content-type" => array:1 [
        0 => "application/json"
      ]
    ]
    #cacheControl: []
  }
  #content: "{"status_code":200,"message":"success","data":{"yh_code":"YH605BEA88E8605","yh_money":null}}"
  #version: "1.0"
  #statusCode: 200
  #statusText: "OK"
  #charset: null
  +original: array:3 [
    "status_code" => 200
    "message" => "success"
    "data" => array:2 [
      "yh_code" => "YH605BEA88E8605"
      "yh_money" => null
    ]
  ]
  +exception: null
}

1.

$result->getData(true);

2.

$result->original

 

标签:laravel,yh,code,200,JsonResponse,cache,json,array,null
来源: https://blog.51cto.com/u_14097531/2972969