This package allows OkHttp and Retrofit users to use Cronet as their transport layer, benefiting from features like QUIC/HTTP3 support or connection migration.
Apache License 2.0
450
stars
34
forks
source link
415 Error When Setting Content-Type Header with Request Header #40
Description:
I'm encountering a 415 (Unsupported Media Type) error when using Cronet to send requests with a request body and an explicitly set Content-Type header
Steps to Reproduce:
Create an OkHttp Request object with a non-empty RequestBody and set the "Content-Type" header to "application/json".
Use the Cronet library to send the request.
Observe a 415 error response from the server.
Expected Behavior:
The server should accept the request with the specified Content-Type and process the JSON payload.
Actual Behavior:
The server returns a 415 error, indicating that it doesn't support the provided Content-Type.
As the above check is incorrect and shouldn't replace Content-Type header with application/octet-stream blindly. It should respect whatever user is setting.
Description: I'm encountering a 415 (Unsupported Media Type) error when using Cronet to send requests with a request body and an explicitly set Content-Type header
Steps to Reproduce: Create an OkHttp Request object with a non-empty RequestBody and set the "Content-Type" header to "application/json". Use the Cronet library to send the request. Observe a 415 error response from the server.
Expected Behavior: The server should accept the request with the specified Content-Type and process the JSON payload.
Actual Behavior: The server returns a 415 error, indicating that it doesn't support the provided Content-Type.
RequestResponseConverter class has
As the above check is incorrect and shouldn't replace
Content-Type
header withapplication/octet-stream
blindly. It should respect whatever user is setting.