读取request.getInputStream流内容
一行行的读取:
打印后期内容格式如下
-----------------------------7da1962f50206
Content-Disposition: form-data; name="info"
-----------------------------7da1962f50206
Content-Disposition: form-data; name="model.username"
瀵规柟
-----------------------------7da1962f50206
Content-Disposition: form-data; name="model.password"
df
-----------------------------7da1962f50206
Content-Disposition: form-data; name="model.age"
34
-----------------------------7da1962f50206
Content-Disposition: form-data; name="model.birthday"
2010-12-15
-----------------------------7da1962f50206
Content-Disposition: form-data; name="model.photo.file"; filename="01300000258678125336696890228.jpg"
Content-Type: image/pjpeg
??
L鷍BQy}T典D?鸅訉t
敋姦篚c經贚,▁yc";f蓀?$8
-----------------------------7da1962f50206
Content-Disposition: form-data; name="model.describe"
瀵瑰瀵瑰鏂圭瓟澶?
-----------------------------7da1962f50206--
其中-----------------------------7da1962f50206是一个分割符
获 取方式
this.boundary = request.getContentType().replaceAll(".+boundary=", "--");
其中
request.getContentType() multipart/form-data; boundary=---------------------------7da8c2d50206
将 multipart/form-data; boundary=--------------------------- 替换成 -- 即可