摘要:
在jetty中是支持put方式操作的,在tomcat中默认是不支持的,解决方式很简单,在web.xml中添加一个过滤器即可。 httpPutFormContentFilter org.springframework.web.filter.HttpPutFormContentFilter httpPutFormContentFilter /* 阅读全文
posted @ 2014-01-04 22:49
coreWars
阅读(1498)
评论(0)
推荐(0)
摘要:
客户端: 因为put只支持单一类型的资源进行传输,所以不能使用像 Multipart/form-data这样的content-type进行描述,而只能使用像image/jpeg 、image/png的形 式进行图片的传输。 代码: RestTemplate restTemplate = super.buildRestTemplate(); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.IMAGE_PNG); ... 阅读全文
posted @ 2014-01-04 22:47
coreWars
阅读(1624)
评论(0)
推荐(0)