1

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?
Jacek Kwiecień
  • 12,397
  • 20
  • 85
  • 157
  • Are you confident that Google provides gRPC bindings for Photos API? The `photoslibrary.googleapis.com` endpoint definitely supports REST. The method [`mediaItems:search`](https://developers.google.com/photos/library/reference/rest/v1/mediaItems/search) is documented. There's a definitive list of gRPC [bindings](https://github.com/googleapis/go-genproto/tree/main/googleapis) for Golang and Photos isn't part of the set. – DazWilkin Jun 20 '22 at 00:51
  • If that endpoint **does** provide a gRPC endpoint then you will probably need to drop `https://` from the URL and add `:443`. – DazWilkin Jun 20 '22 at 00:53

0 Answers0