2010年4月11日 星期日

取得 HTTP post 的 body

要取得 HTTP POST 的 body 可以使用 ServletRequest interface 的兩個方法: 

BufferedReader getReader()
          Retrieves the body of the request as character data using a BufferedReader.

ServletInputStream getInputStream()
          Retrieves the body of the request as binary data using a ServletInputStream.


getReader() 方法用於字元資料, getInputStream() 方法用於 binary data

沒有留言: