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

InterceptedHttp get not working with int parameters #88

Closed meysammahfouzi closed 3 years ago

meysammahfouzi commented 3 years ago

Describe the bug I was trying to get an endpoint with int parameter:

final response =
          await http.get("$baseUrl/weather".toUri(), params: {'id': 1});

I was wondering why id: 1 is not received on the server. After some investigation I realized that the parameter values are included in the requet only if they are string:

final response =
          await http.get("$baseUrl/weather".toUri(), params: {'id': '1'});

Expected behavior I expect the parameters to be included even when they are not string:

final response =
          await http.get("$baseUrl/weather".toUri(), params: {'id': 1});

Please complete the following information

CodingAleCR commented 3 years ago

Thank you for the issue, I will take a look ASAP as I think this is critical