commonMain.com.apollographql.apollo.api.http.ByteStringHttpBody.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apollo-api-jvm Show documentation
Show all versions of apollo-api-jvm Show documentation
Apollo GraphQL API classes
The newest version!
package com.apollographql.apollo.api.http
import okio.BufferedSink
import okio.ByteString
import okio.ByteString.Companion.encodeUtf8
class ByteStringHttpBody(
override val contentType: String,
private val byteString: ByteString
): HttpBody {
constructor(contentType: String, string: String): this(contentType, string.encodeUtf8())
override val contentLength
get() = byteString.size.toLong()
override fun writeTo(bufferedSink: BufferedSink) {
bufferedSink.write(byteString)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy