Retrofit 2 check call URL

前端 未结 3 1884
轮回少年
轮回少年 2020-12-16 02:05

Is there any possibility to compare a Call URL with a String in Retrofit 2?

For example we can take this baseUrl:

3条回答
  •  悲&欢浪女
    2020-12-16 02:24

    Assuming you're using OkHttp alongside Retrofit, you could do something like:

    dummyService.exampleList("partialDummy").request().url().toString()

    which according to the OkHttp docs should print:

    https://www.google.com/dummy/partialDummy

提交回复
热议问题