CodingAleCR / http_interceptor

A lightweight, simple plugin that allows you to intercept request and response objects and modify them if desired.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

InterceptedHttp get not working with int parameters

meysammahfouzi opened this issue · comments

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

  • Flutter version: Flutter 2.4.0-1.0.pre.60
  • IDE: Android Studio
  • http_interceptor Version 1.0.1

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