# Ktor client fetch protocol buffers content

**URL:** <https://discuss.kotlinlang.org/t/ktor-client-fetch-protocol-buffers-content/10986>\
**Category:** Support\
**Created:** [January 1, 2019, 9:53pm UTC](https://discuss.kotlinlang.org/t/ktor-client-fetch-protocol-buffers-content/10986 "2019-01-01T21:53:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luistrigueiros](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/luistrigueiros/32/2161_2.png) [@luistrigueiros](https://discuss.kotlinlang.org/u/luistrigueiros)\
**Post date:** [January 1, 2019, 9:53pm UTC](https://discuss.kotlinlang.org/t/ktor-client-fetch-protocol-buffers-content/10986/1 "2019-01-01T21:53:35Z")

</div>

Question:

Is it possible to use Ktor client to fetch binary encoded content using protocol buffers ?  
So the server would serve a response having in the body content binary data encoded using Google Protocol Buffers, ie I would need to be able to read the response as raw byte arrays.

Thank you, kindly  
Luis Oscar Trigueiros

---

<div class="post-metadata">

**Author:** ![cretz](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@cretz](https://discuss.kotlinlang.org/u/cretz)\
**Post date:** [January 2, 2019, 4:44pm UTC](https://discuss.kotlinlang.org/t/ktor-client-fetch-protocol-buffers-content/10986/2 "2019-01-02T16:44:50Z")

</div>

> [@luistrigueiros](#):
>
> Is it possible to use Ktor client to fetch binary encoded content using protocol buffers ?

Sure. I assume you mean a simple HTTP 1.1 server literally marshalling bytes into the response body. Just take byte responses like you would any other [ktor client call](https://ktor.io/clients/http-client.html#requests-responses) and use the byte array unmarshaller of your protobuf library of choice. If you mean gRPC, no, that’s a different deal.
