PHP-Code:
curl -v \
-b cookie.txt \
-X POST \
-F ':parameters={"ziel": "http://test.com/test.json", "mediaPaths": ["media://testfile_a_1.mxf", "media://testfile_a_2.mxf", "media://testfile_a_3.mxf", "media://testfile_a_4.mxf"], "comment": "Test"}' \
http://test.com/jobs/ingest.json
Key =

Value = {"destination": "http://test.com/test.json", "mediaPaths": ["media://testfile_a_1.mxf", "media://testfile_a_2.mxf", "media://testfile_a_3.mxf", "media://testfile_a_4.mxf"], "comment": "Test"}
ODER ?
PHP-Code:
//Erstelle MediaPaths Array
$mediaPaths_array = array("media://testfile_a_1.mxf", "media://testfile_a_2.mxf", "media://testfile_a_3.mxf", "media://testfile_a_4.mxf");
//Json_Encode MediaPaths Array
$data = array(
':parameters' => json_encode(array('destination' => 'http://test.com/test.json', 'mediaPaths' => $mediaPaths_array, 'comment' => 'Kommentar'), JSON_UNESCAPED_SLASHES)
);
Das ist meine Ausgabe:
PHP-Code:
Array ( [:parameters] => {"destination":"http://test.com/test.json","mediaPaths":["media://testfile_a_1.mxf","eamedia://testfile_a_2.mxf","media://testfile_a_3.mxf","media://testfile_a_4.mxf"],"comment":"Kommentar"} )
Der Value von Parameters ist doch ein Json Objekt oder ? Was sagen die Fachmänner ?
Einen Kommentar schreiben: