Colon in grpc url while using wire

141 views Asked by At

I'm trying to make a call to grpc syntax URL: https://photoslibrary.googleapis.com/v1/mediaItems:search by using Wire framework.

First problem is putting /v1 in path as below configuration ignores it:

GrpcClient.Builder()
            .client(okHttpClient)
            .baseUrl("https://photoslibrary.googleapis.com/v1")
            .build()

Such config make calls to https://photoslibrary.googleapis.com

Second problem is colon in the URL. Here is my proto config:

service MediaItems {
  rpc Search(SearchMediaItemCommand) returns (stream SearchMediaItemUpdate) {}
}

With this I end up with call to URL: https://photoslibrary.googleapis.com/MediaItems/Search

  1. How to add v1 to the base URL? (I can do this by adding interceptor in okhttpclient but it doesn't feel right)
  2. How to config protocol for colon (:) in URL?
0

There are 0 answers