请求如下:
HTTP/1.1 200 OK
Connection: keep-alive
Date: Sat, 15 Nov 2014 11:15:21 GMT
X-Powered-By: Express
content-length: 278
content-type: application/json
{
"file": {
"buffer": null,
"encoding": "7bit",
"extension": "pdf",
"fieldname": "file",
"mimetype": "text/plain",
"name": "f459076685288eed5b4b45f80a11b908.pdf",
"originalname": "test.pdf",
"path": "uploads/f459076685288eed5b4b45f80a11b908.pdf",
"size": 59353,
"truncated": false
}
}
谢谢
直接建一个类来当做参数映射,参考这里: http://segmentfault.com/q/1010000000793073
这个不就是一个json数据吗?按照这种格式,建一个类,使用spring mvc的@RequestBody,直接就转换成对象了。需要在配置文件配置一下。可以看一下这个:http://www.chawenti.com/articles/23596.html