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

How do you add custom encoders and payload? #4

Open
mbalex99 opened this issue Mar 13, 2019 · 2 comments
Open

How do you add custom encoders and payload? #4

mbalex99 opened this issue Mar 13, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@mbalex99
Copy link

I have a server that supports CBOR and MessagePack, how would I be able to customize the encoder for the payloads and response types?

@MihaelIsaev
Copy link
Member

How data exchanging works with CBOR?

I mean that with JSON we're getting JSON-string as a response from server, and we're sending POST/PUT requests either with JSON payload, or with multipart/form-data payload.
But with CBOR are we getting just a raw Data as a response from a server? And are we sending binary data as payload for POST/PUT requests all the time?

Sorry for dumb questions, I did some research, but I have no experience with CBOR yet, so idk how binary data exchanging works in comparison with classic json.

Answering your question:
Custom encoders/decoders are not supported at the moment, I mean that everything happens under the hood without ability to set your own encoder/decoder. But I can change it by adding something like CustomDecoder and CustomPayload protocols.

@mbalex99
Copy link
Author

  • Yes with CBOR it'd be binary data from and to the server.
  • A custom encoder/decoder would be amazing! (JSON should be default) but it would be great to be able to change it globally and override it per request

@MihaelIsaev MihaelIsaev added the enhancement New feature or request label Mar 13, 2019
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

No branches or pull requests

2 participants