Please disable Adblockers and enable JavaScript for domain CEWebS.cs.univie.ac.at! We have NO ADS, but they may interfere with some of our course material.

PUT the parameters

Send multiple parameters 
 
$data = http_build_query(
  array(
    'param1' => SOME_JSON_OR_XML_STRING,
    'param2' => SOME_JSON_OR_XML_STRING
  )
);
$opts = array('http' =>
  array(
    'method'  => 'PUT',
    'header'  => 'Content-type: application/x-www-form-urlencoded',
    'content' => $data
  )
);
$context = stream_context_create($opts);
$result = file_get_contents('http://...', false, $context);
 
Send multiple JSON 
 
$opts = array('http' =>
  array(
    'method'  => 'PUT',
    'header'  => 'Content-type: application/json',
    'content' => JSON_DATA
  )
);
$context = stream_context_create($opts);
$result = file_get_contents('http://...', false, $context);
Letzte Änderung: 11.12.2014, 08:27 | 48 Worte