android端构建的http请求如这样
POST /api/file/upload HTTP/1.1
Content-Type: image/jpeg
User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.3; HTC One Build/KTU84L)
Host: 192.168.0.50:8080
Connection: Keep-Alive
Accept-Encoding: gzip
Content-Length: 9152
{..... body ....}
我的服务端代码是:
@AdaptBy(type = WhaleAdaptor.class) //(这里我还用过(type = UploadAdaptor.class, args = {"ioc:imageUpload"}))
@POST
@At("/upload")
@Ok("json")
public Object image(@Param("filedata") TempFile[] temps,
@Attr(Constant.SESSION_KEY.UID) int uid,
AdaptorErrorContext err) {
请求后的结果都是空的文件;
我查看了请求,的确是把文件io丟到服务器了,个人感觉在adapter的地方没有做好解析;
问题:如何去捣鼓这个adapter? 或许该问这个Content-Type: image/jpeg 类型多种多样,如何来做适配?