I've been searching for awhile on this topic. I'm trying to send data to my backend server using OkHttp. However, I am getting this error:
okhttp3.internal.http2.StreamResetException: stream was reset:PROTOCOL_ERROR
val client = OkHttpClient()
val response = client.newCall(
Request.Builder()
.addHeader("Authorization:", "Bearer $firebaseToken")
.url("https://someURL/"+ podcastId.toString())
.build())
.execute()
I'm not sure if this has to do with the URL or my Authorization header? Any help would be appreciated, thanks in advance.
I solved a similar problem by restricting the request to use HTTP 1, see:
OkHttpClient okHttpClient = new OkHttpClient();
okHttpClient.setProtocols(Arrays.asList(Protocol.HTTP_1_1));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With