Howto translte this curl post into php
one text
Solution:
Try this: the $result
is your JSON-Object you recived from the URL.
<?php
$headers = [
'Content-Type: text/plain',
'Accept: application/json'
];
$url = 'http://{IP}:8080/rest/items/item';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 25);
$result = json_decode(curl_exec($ch));
if (curl_errno($ch))
echo 'Error:' . curl_error($ch);
curl_close($ch);
var_dump($result);
i hope this is want you want/need/mean with "builtin functions".
Source