首页 > 解决方案 > 添加标题时的改造错误

问题描述

我想在改造中添加标题。

@Headers({"Accept: text/event-stream"})
@GET("condition.json")
Call<String> getCondition();

但我总是收到这个错误。

Exception in thread "main" java.lang.IllegalArgumentException: Unexpected char 0x20 at 6 in header name: Accept 

有什么建议吗?提前致谢

标签: javaretrofit2okhttp3

解决方案


推荐阅读