Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content-Type is automatically set when connecting with Protobuf #683

Open
KyoheiG3 opened this issue Jun 18, 2024 · 0 comments
Open

Content-Type is automatically set when connecting with Protobuf #683

KyoheiG3 opened this issue Jun 18, 2024 · 0 comments

Comments

@KyoheiG3
Copy link

Describe the bug
Even if setting Content-Type in the @Headers annotation, if the payload conforms to GeneratedMessage, it will be automatically set to application/x-protobuf.

To Reproduce
Generates Protobuf request.

@POST('/path/to/endpoint')
@Headers({'Content-Type': 'application/proto'})
Future<void> postMessage({
  @Body() Params message,
});

Expected behavior
It should not be automatically set to application/x-protobuf.

Additional context
We are using Connect for our server. This framework provides REST and RPC, and when making REST requests with Protobuf, it requires setting the Content-Type to application/proto. Retrofit will automatically set it to application/x-protobuf if the payload inherits to GeneratedMessage. Is there a way to not set this value automatically or to change it to application/proto?

The specification of Content-Type of Connect is here.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant