RestClient icon indicating copy to clipboard operation
RestClient copied to clipboard

How to use handler / interceptor while (de)serializing the json content?

Open coldfish opened this issue 6 years ago • 6 comments

I'd like to write an interceptor to manipulate the body content of HTTP calls. Before sending, it's needed to be converted to Encrypted data as byte[] and after receiving, deserialize the object as well. I don't want to make this manipulation for each web requests and finally, I need them to get as pure T Request/Response classes.

Is there any way to handle the http calls in one-place for requests/responses?

coldfish avatar Jul 31 '19 14:07 coldfish

You can start checking here https://github.com/proyecto26/RestClient/blob/master/src/Proyecto26.RestClient/Helpers/HttpBase.cs#L81

jdnichollsc avatar Jul 31 '19 15:07 jdnichollsc

I'm confused a little bit. Do you suggest me to edit source code directly or a technique to override this method I'm not aware of?

coldfish avatar Aug 01 '19 06:08 coldfish

Any pull request is always welcome mate, this is a community plugin 🙂

jdnichollsc avatar Aug 01 '19 06:08 jdnichollsc

Thanks for your support. I'll do if I make it worked..

coldfish avatar Aug 01 '19 06:08 coldfish

You don't need to close this, anyone could do this task in their spare time, that's Open Source :) Also, if you need this urgently you can ask for support with Tidelift here 👍

jdnichollsc avatar Aug 02 '19 05:08 jdnichollsc

@coldfish do you have any example with C#?

jdnichollsc avatar Sep 18 '19 18:09 jdnichollsc