retrofit icon indicating copy to clipboard operation
retrofit copied to clipboard

在使用协程时返回值可为空

Open ZQ-BB opened this issue 3 years ago • 2 comments
trafficstars

在我使用协程时,我希望能在接口返回空值时能获取到空值,但是我在实际运行过程中无法获取,同时报错

Response from XXX was null but response body type was declared as non-null

然后再查看源码时发现,HttpServiceMethod中,没有调用awaitNullable的逻辑,希望能够加上这个

ZQ-BB avatar May 07 '22 03:05 ZQ-BB

Use english dude.

wonsuc avatar Jun 02 '22 01:06 wonsuc

你可以这么做 @POST(URL) suspend fun base():Bean?

moten07 avatar Jun 05 '22 14:06 moten07

你可以这么做 @post(URL) suspend fun base():Bean?

没用的 yuan'ma源码中的 continuationBodyNullable 是写死的 false image

xiaojinzi123 avatar Nov 16 '22 07:11 xiaojinzi123

Duplicate of #3075

Goooler avatar Dec 29 '23 07:12 Goooler

这个问题可以关了,关注那个就好

Goooler avatar Dec 29 '23 07:12 Goooler