[英]How to get response with header code, body,… without Gson converter in Retrofit2 and Rx
I've an issue. 我有问题 I want to get raw response (as byte stream) and manual convert body to model object (not using converter).
我想获取原始响应(作为字节流),并将主体手动转换为模型对象(不使用转换器)。
@GET("searchShop")
fun search(
@Query("keyword") keyword: String,
@Query("lat") location: Double? = null,
@Query("lng") limit: Double? = null
): Observable<?????> // what should I put in there ?
I've search but I can't find out any solutions. 我已经搜索了,但是找不到任何解决方案。 Some bro tell me that pass
Response<T>
in "?????"
一些兄弟告诉我,在
"?????"
中传递Response<T>
but it throw exception: 但它抛出异常:
Unable to create converter for class T
无法为T类创建转换器
What should I do? 我该怎么办? Many thanks!
非常感谢!
I've found out solution. 我找到了解决方案。 Use
Observable<Response<ResponseBody>>
to handle this case. 使用
Observable<Response<ResponseBody>>
处理这种情况。 Thank every one! 谢谢大家!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.