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

HttpClientWithInterceptor.send #37

Closed MichelFortes closed 4 years ago

MichelFortes commented 4 years ago

Hello guys. It looks like httpClientWithInterceptor.send(BaseRequest request) doesn't use interceptors, retry policies and request timeouts. Is this a desired behavior? Best regards

issue-label-bot[bot] commented 4 years ago

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

CodingAleCR commented 4 years ago

Hi, at the moment yes, send is used internally and I have not worked on adding support for it just yet. It is, however, in the close roadmap goals.

CodingAleCR commented 2 years ago

Using send method was added on #98 and to the 2.0.0 beta, feel free to try it out if you want ;)

dexcell commented 2 years ago

@CodingAleCR send method still not available on 2.0.0 beta2 Could you please add to 2.0.0 beta3

I need to post form data with multipart usingsend perhaps something like this:

// Create normal http request
http.MultipartRequest request = new http.MultipartRequest("POST", Uri.parse("$baseUrl/account/profile"));

// Add some file
request.files.add(await http.MultipartFile.fromPath(entry.key, entry.value.path, contentType: MediaType('image', 'jpeg')));

// Use intercepted http to send the request
final http.StreamedResponse response = await interceptedHttp.send(request);