I'm sending a HTTP Post request through API to another service to create an order. Problem is, it requires some HTTP parameters that are array within array.
These are the params I'm using now:
"Content-Type: application/json",
"Accept: application/json",
"Stream-Nonce:".$randomstring2,
"Stream-Party:***************",
"Authorization: bearer ".$result_array["access_token"],
and I need to add this:
"header": {
"orderNo": "ABCD123456",
"orderDate": "2018-07-23",
"requiredDate": "2018-07-31",
"partner": {},
"orderType": "DELIVERY",
"serviceLevel": "STANDARD",
"services": [],
"customer": {},
"customerOrderNo": "ABC1234567890",
"orderNotes": "These notes relate to the order",
"driverNotes": "These notes are for the driver",
"routeInfo": "CC05"
},
This is directly from the service I'm using documentation. Problem is with "header": {...}.
I tried doing a different array format, like this:
'Content-Type' => ' application/json',
'Accept' => ' application/json',
'Stream-Nonce' => ''.$randomstring2,
'Stream-Party' => '***************',
'Authorization' => ' bearer '.$result_array['access_token'],
in which case I believe it would be easy to just enter ... => array('yada yada' => 'yada'); however after doing this, the headers don't work at all, I get forbidden message when sending a request.
What can I do here? Thanks.