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

Add body type getter in Convert trait #40

Closed
ionut-arm opened this issue Apr 9, 2020 · 1 comment · Fixed by #42
Closed

Add body type getter in Convert trait #40

ionut-arm opened this issue Apr 9, 2020 · 1 comment · Fixed by #42
Labels
enhancement New feature or request

Comments

@ionut-arm
Copy link
Member

Request and response bodies are converted to and from raw byte format using code specific to each body type that we support. In order to have modularity, though, converters are handled through a Convert trait. However, in order to correctly compose requests and responses, you explicitly need to know the BodyType that you're using.

Because the components doing the body conversion usually also create the request or response header (be it either in the service or in the client), it makes sense to be able to retrieve the BodyType straight from the converter, minimizing the risk of the two (body encoding type and encoding type identifier in the header) becoming inconsistent.

@ionut-arm ionut-arm added the enhancement New feature or request label Apr 9, 2020
@hug-dev
Copy link
Member

hug-dev commented Apr 9, 2020

That's a good point! It will also simplify the BackEndHandler in the service to not duplicate that information.

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

Successfully merging a pull request may close this issue.

2 participants