0
我想從Java中讀取POST數據。 我有形式registrationForm.html:Http協議POST閱讀
<form action="registratrationResult.html" method="post">
Mail:<br>
<input type="text" name="mail">
<br>
Password:<br>
<input type="password" name="password">
<input type="submit">
</form>
我想在java中不使用servlet來閱讀。我讀到的一切,從瀏覽器中,我得到了它:
>POST /registratrationResult.html HTTP/1.1
>Host: localhost:8080
>Connection: keep-alive
>Content-Length: 29
>Cache-Control: max-age=0
>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
>Origin: http://localhost:8080
>Upgrade-Insecure-Requests: 1
>User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36
>Content-Type: application/x-www-form-urlencoded
>Referer: http://localhost:8080/registrationForm.html
>Accept-Encoding: gzip, deflate
>Accept-Language: pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4
我看,應該是這樣的:
parameter=value&also=another
如何獲得呢? 當我更改輸入數據時,內容長度正在改變。
我想看看如何獲得POST響應的代碼示例,它是在服務器端還是客戶端? –