我想测试我写的API。
我的API @Produces("text/csv")
并返回标题content-disposition: attachment; filename = research.csv
我可以在我的REST日志过滤器中看到以下内容:
INFO: 2 * Server responded with a response on thread http-bio-8080-exec-3
2 < 200
2 < content-disposition: attachment; filename = algopix-research.csv
2 < Content-Type: text/csv
"885909727919","whateve","Apple iPhone 5s 16GB 4G LTE Gold - Sprint"
"885909727919","whateve","Apple iPhone 5s 16GB 4G LTE Gold - Sprint"
然而在REST chrome extension中,我没有把它作为一个附件而是作为String输出:
"885909727919","whateve","Apple iPhone 5s 16GB 4G LTE Gold - Sprint"
"885909727919","whateve","Apple iPhone 5s 16GB 4G LTE Gold - Sprint"
我确实看到以下响应标题
Server: Apache-Coyote/1.1
Access-Control-Allow-Origin: chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: Access-Control-Allow-Origin,Access-Control-Allow-Credentials
content-disposition: attachment; filename = algopix-research.csv
Content-Type: text/csv
Content-Length: 143
Date: Tue, 13 Jan 2015 19:06:08 GMT
我的代码或REST chrome扩展程序中的错误是否不会返回attachemnt?