i have this function to store data from a blade form:
$store = Http::withHeaders([
'Content-Type' => 'application/json',
'Authorization' => $token,
])->post('http://example.com/api/Order/', [
'Key' => 1167722,
'No' => "12",
'TL' => [
'Dtl' => "",
'Code' => "Screw Hex",
'IsDetail' => true,
"DTL" => [],
]
]);
return $store;
and this is what the response return:
{"Key":1167722,"No":"12","TL":[]}
and nothing is saved inside TL array i tried wrapping TL array with json_encode() and still no luck and i tried
'TL[Dtl]' => 722,
and it didn't store as well
TLis empty in the response or in the incoming request? Because ifTLis empty in the response the problem is not yours but of the server that gives you the response.'TL' => json_encode(['Code' => "Screw Hex",])