Loading...
xxxxxxxxxx
$url = 'http://url-to-send-data.com';
$json_data = '
{
"data":{
"type":"Addresses",
"attributes":{
"id": 74534234878278221
}
}
}';
$opts = [
'http' => [
'method' => 'POST',
'header' => "Content-type: application/json\nAuthorization: be6759482c99c2e65f096dfa5e401333200c83ba",
'content' => $json_data
]
];
$context = stream_context_create($opts);
$result = file_get_contents($url, false, $context);
if(http_response_code() == '200' || http_response_code() == '201') {
Comments (0)