dio icon indicating copy to clipboard operation
dio copied to clipboard

Dio makes POST request fine in the debug version of the app but doesn't in release.

Open Vairochan opened this issue 2 years ago • 2 comments

New Issue Checklist

  • [ ] I have searched for a similar issue in the project and found none

Issue Info

Info Value
Platform Name e.g. flutter / ios / android
Platform Version e.g. 1.5.0 / 12.0 / 9.0
Dio Version 4.0.3

Issue Description and Steps

Please fill in the detailed description of the issue (full output of any stack trace, compiler error, ...) and the steps to reproduce the issue.

Vairochan avatar Nov 17 '21 19:11 Vairochan

This issue doesn't provide any useful information. Please update your issue with a minimal working code sample which reproduces your issue.

jgoyvaerts avatar Nov 22 '21 12:11 jgoyvaerts

Hey, So I just resolved an issue relating to this but while using the retrofit library Retro

Environment

  • flutter 2.5.3
  • sdk: ">=2.12.0 <3.0.0"
  • dio: ^4.0.1
  • retrofit: ^2.0.1
  • retrofit_generator: "2.0.1"

I noticed if the leading "/' is missing it will be automatically added in debug mode but not in release

resulting in your API calls working on debug but not in release mode

Essentially...

@GET('/stores/{companyId}/inventory/wip?includeItems=true&limit={limit}&offset={offset}&order=ASC')

results in "baseUrl/stores..."

VS

@GET('stores/{companyId}/inventory/wip?includeItems=true&limit={limit}&offset={offset}&order=ASC') (Fails) resulting in "baseurlstore" which would give you a Host not found exception

TheHazeEffect avatar Mar 01 '22 07:03 TheHazeEffect