2
ich in PHP so etwas wie Controller implementieren möchten, recieves dass so etwas wie https://developers.google.com/drive/v3/web/manage-uploads#multipartPHP, wie empfangen und analysiert wird Content-Type: multipart/verwandt;
POST /files HTTP/1.1
Host: my-foo-host
Content-Type: multipart/related; boundary=test
Content-Length: 226
--test
Content-Type: application/vnd.api+json; charset=UTF-8
{"data":{"some-meta-data-key":"some-meta-data-value"}}
--test
Content-Type: text/plain; charset=utf-8
Content-transfer-encoding: base64
UGNsYXNzIEZhcmUK
--test--
Gibt es dafür irgendwelche Lösungen in PHP es vaidate und in so etwas wie zu repräsentieren:
php > $requestData = get_data();
php > foreach ($requestData as $dataItem) {
php > echo $dataItem->getContentType() . PHP_EOL;
php > echo $dataItem->getBody() . PHP_EOL;
php > echo PHP_EOL;
php > }
application/vnd.api+json; charset=UTF-8
{"data":{"some-meta-data-key":"some-meta-data-value"}}
text/plain; charset=utf-8
UGNsYXNzIEZhcmUK