21
我有用於從應用程序發送錯誤報告到服務器的HTML表單。我需要以編程方式模仿此行爲。相應的POST請求(或一系列請求)會是什麼樣子?如何在POST請求中模仿HTML表單提交?
<form name="bugreport" method="post" enctype="multipart/form-data" action="http://my-server.com/bugreport.php">
<div name="SentData">
<textarea name="logfile" class="UserVisible"></textarea><br>
<textarea name="configfile" class="UserVisible"></textarea><br>
</div>
<textarea name="usercomment" class="invisible"></textarea><br>
<input name="useremail" type="text" class="invisible">
<input class="invisible" type="submit" value="Send">
</form>
謝謝! FireBug真的很有幫助(但事實證明,一旦你知道原理,你就不需要它)。 –
假設服務器**可以**處理它們,那麼HTTP **協議** **是否允許**「垃圾數據」用於內容類型的x-www-form-urlencoded?例如。 'logfileblabla&configfile ===== mo + uselo &&& useremail =&=&=&+' – Pacerier
謝謝。這就是我一直在尋找的東西。 – Joey