title: Unhandled Exception: FormatException: Unexpected end of input (at character 1)
body: <p>I am trying to parse following map using http in flutter</p>
  
  <pre><code> Map&lt;String, dynamic&gt; map = {
        "studentID": "${widget.userId}".toString(),
        "gstNumber": "${widget.feesBloc?.gstNumberValue}" ?? "",
        "entityName": "${widget.feesBloc?.gstEntityValue}" ?? "",
        "paymentInfo": {
          "amount": "$tempAmount".toString(),
          "razorpay_payment_id": "$razorPaymentId" ?? "",
          "usedWB": "$_walletAmount"
        },
        "feeInfo": {
          "feeID": "${widget.feesData.feeID}".toString(),
          "type": "${widget.feesData.type}",
          "category": "${widget.feesData.category}".toString(),
          "feeCode": "${widget.feesData.feeCode}".toString(),
          "feeShortName": "${widget.feesData.feeShortName}" ?? "",
          "basicAMT": "${widget.feesData.basicAMT}".toString(),
          "dueDate": "${widget.feesData.dueDate}".toString(),
          "grandAMT": "${widget.feesData.grandAMT}",
          "status": "${widget.feesData.status}".toString(),
          "collectionID": "${widget.feesData.collectionID}".toString(),
          "dateStatus": "${widget.feesData.dateStatus}".toString(),
          "collectionDetailStatus": "-1",
          "schemeInfo": {
            "schemeID": "1",
            "schemeNo": "${widget.feesData.schemeInfo.schemeNo}",
            "schemeTxt": "a" ?? "",
            "schemeStatus": "${widget.feesData.schemeInfo.schemeStatus}"
          },
          "lateFeeInfo": {
            "lateDays": "${widget.feesData.lateFeeInfo.lateDays}",
            "lateFeePerDay":
                "${widget.feesData.lateFeeInfo.lateFeePerDay}".toString(),
            "lateFeeAMT": "${widget.feesData.lateFeeInfo.lateFeeAMT}"
          },
          "taxInfo": {
            "tax": "${widget.feesData.taxInfo.tax}".toString(),
            "taxAMT": "${widget.feesData.taxInfo.taxAMT}".toString(),
            "taxAddedAMT": "${widget.feesData.taxInfo.taxAddedAMT}"
          },
          "scholarshipInfo": {
            "scholarship":
                "${widget.feesData.scholarshipInfo.scholarship}".toString(),
            "scholarshipAMT": "${widget.feesData.scholarshipInfo.scholarshipAMT}"
          }
        }
  </code></pre>
  
  <p>Following is my api code</p>
  
  <pre><code>Map&lt;String, String&gt; headers = {
        'Content-type': 'application/json',
        'Accept': 'application/json',
      };
  
      final response = await http.post(FEE_PAYMENT_URL,
          headers: headers, body: json.encode(jsonMap));
  </code></pre>
  
  <p>I am getting status code as 200 but <code>response.body</code> is not returned anything so the decoding fails</p>
  
  <p>Following is the full error </p>
  
  <pre><code>Unhandled Exception: FormatException: Unexpected end of input (at character 1)
  E/flutter ( 8915): 
  E/flutter ( 8915): ^
  E/flutter ( 8915): 
  E/flutter ( 8915): #0      _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1392:5)
  E/flutter ( 8915): #1      _ChunkedJsonParser.close (dart:convert-patch/convert_patch.dart:510:7)
  E/flutter ( 8915): #2      _parseJson (dart:convert-patch/convert_patch.dart:30:10)
  E/flutter ( 8915): #3      JsonDecoder.convert (dart:convert/json.dart:493:36)
  E/flutter ( 8915): #4      JsonCodec.decode (dart:convert/json.dart:151:41)
  E/flutter ( 8915): #5      FeePaymentApiProvider.submitFeePayment (package:dice/resources/fee_payment/fee_payment_api_provider.dart:22:42)
  E/flutter ( 8915): &lt;asynchronous suspension&gt;
  E/flutter ( 8915): #6      FeePaymentRepository.submitFeePayment (package:dice/resources/fee_payment/fee_payment_repository.dart:14:48)
  E/flutter ( 8915): &lt;asynchronous suspension&gt;
  E/flutter ( 8915): #7      FeesBloc.submitFeePayment (package:dice/bloc/fees_bloc/fees_bloc.dart:54:40)
  E/flutter ( 8915): &lt;asynchronous suspension&gt;
  E/flutter ( 8915): #8      _PresentFeesListItemState._submitDataToServerAfterPaymentIsSuccessful (package:dice/screens/fees/present_fees/present_fees_list_item.dart:517:21)
  E/flutter ( 8915): #9      _PresentFeesListItemState.calculateFees (package:dice/screens/fees/present_fees/present_fees_list_item.dart:202:9)
  E/flutter ( 8915): #10     _PresentFeesListItemState.build.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:dice/screens/fees/present_fees/present_fees_list_item.dart:165:21)
  E/flutter ( 8915): #11     _rootRunUnary (dart:async/zone.dart:1132:38)
  E/flutter ( 8915): #12     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
  E/flutter ( 8915): #13     _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
  E/flutter ( 8915): #14     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
  E/flutter ( 8915): #15     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
  E/flutter ( 8915): #16     Future._complete (dart:async/future_impl.dart:473:7)
  E/flutter ( 8915): #17     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
  E/flutter ( 8915): #18     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:28:18)
  E/flutter ( 8915): #19     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:294:13)
  E/flutter ( 8915): #20     checkInternetConnection (package:dice/helpers/check_internet_connection.dart)
  E/flutter ( 8915): &lt;asynchronous suspension&gt;
  E/flutter ( 8915): #21     _PresentFeesListItemState.build.&lt;anonymous closure&gt; (package:dice/screens/fees/present_fees/present_fees_list_item.dart:163:17)
  E/flutter ( 8915): #22     _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:635:14)
  E/flutter ( 8915): #23     _InkResponseState.build.&lt;anonymous closure&gt; (package:flutter/src/material/ink_well.dart:711:32)
  E/flutter ( 8915): #24     GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
  E/flutter ( 8915): #25     TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:365:11)
  E/flutter ( 8915): #26     TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:312:7)
  E/flutter ( 8915): #27     GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
  E/flutter ( 8915): #28     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:222:20)
  E/flutter ( 8915): #29     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
  E/flutter ( 8915): #30     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
  E/flutter ( 8915): #31     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
  E/flutter ( 8915): #32     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
  E/flutter ( 8915): #33     _rootRunUnary (dart:async/zone.dart:1136:13)
  E/flutter ( 8915): #34     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
  E/flutter ( 8915): #35     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
  E/flutter ( 8915): #36     _invoke1 (dart:ui/hooks.dart:250:10)
  E/flutter ( 8915): #37     _dispatchPointerDataPacket (dart:ui/hooks.dart:159:5)
  E/flutter ( 8915): 
  </code></pre>
  
  <p>Any help would be appreciated. I went through following questions on stack but they were of no use. I am passing complex map structure the right way to my api in dart, the api works fine on postman</p>