![]() | 1 zhchyu999 2018-09-16 10:20:00 +08:00 via Android okhttp 有个拦截器 |
![]() | 2 saximoer 2018-09-16 11:18:41 +08:00 ohhttp 有一个 Interceptor 接口 实现这个接口就 实现了拦截器的功能 然后记得把这个拦截器加入 okhttp 的声明中就可以了 |
![]() | 3 hongch 2018-09-16 17:18:56 +08:00 via iPhone intercept 可以看一下 okhttp 源码 interceptchain 允许加入两个 intercept 分别是请求前和请求后 |
4 nextdiscover OP |
5 nextdiscover OP |
6 nextdiscover OP |
![]() | 7 saximoer 2018-09-17 00:19:03 +08:00 |
![]() | 8 wsxyeah 2018-09-17 08:23:50 +08:00 via iPhone interceptor 里肯定不能直接拿到 retrofit 里的 field 啊,只能拿到 request body,可以从 request body 里取出字段再操作 |
9 nextdiscover OP @wsxyeah 嗯嗯,今天试试,谢谢 |
10 nextdiscover OP @saximoer 谢谢,我去看看 |
![]() | 11 hongch 2018-09-17 12:40:06 +08:00 - - @nextdiscover 当然是拿 requestbody 如果是 get 请求就从 url 里拿 |
![]() | 12 zhchyu999 2018-09-17 18:06:32 +08:00 印象中好像是改不了,得 new 一个新的 |
13 lx0758 2018-12-19 15:26:52 +08:00 |