私はPHPを使用してAPIを開発しています。PUT経由でファイルの先頭に余分なヘッダーを追加する方法を教えてください。
私はPUTリクエストでXMLファイルを受け取ります。
はポストマンと私のアプリを開発する私は、以下を参照してください。
------WebKitFormBoundary0ASxhcJEf0dqxS1P
Content-Disposition: form-data; name=""; filename="books.xml"
Content-Type: text/xml
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
...
</catalog>
------WebKitFormBoundary0ASxhcJEf0dqxS1P--
私はecho file_get_contents("php://input")
経由でそれを持ってきました。
WebKitのように見えるこの余分なデータを傍受または浄化することはできますか?
どのようにリクエストされましたか? –
@ DanielA.White with Postmanフォームデータでファイルを添付します。 – mike
フォームデータでは行いません。 –