CodingAleCR / http_interceptor

A lightweight, simple plugin that allows you to intercept request and response objects and modify them if desired.
MIT License
134 stars 67 forks source link

BaseRequest field is missing in ResponseData #83

Closed II11II closed 3 years ago

II11II commented 3 years ago

In mapper method Response toHttpResponse() and factory factory ResponseData.fromHttpResponse(Response response) , mapping BaseRequest is missing. P.s. in Response toHttpResponse() method maps to Request only method and Uri. But headers and bodies are missing

CodingAleCR commented 3 years ago

Thank you for opening the issue, I will get to it ASAP🔥

II11II commented 3 years ago

@CodingAleCR Thank you) I would like to ask why custom models f.e. RequestData and ResponseData are created? May they be replaced by default http library models, Request and Respone respectively?

CodingAleCR commented 3 years ago

They are needed in order to provide mutable versions of Request and Response classes on http. For example, query parameters are not mutable in Request, and thus you are not able to intercept those.

CodingAleCR commented 3 years ago

@all-contributors add @II11II for tests and code

allcontributors[bot] commented 3 years ago

@CodingAleCR

I've put up a pull request to add @II11II! :tada: