Skip to content

Using the mappable mixin method to generate beans as the body request parameter for Dio or Retrofit,It's not work #2

Description

@Clearlove2015

error log1:
[🔔 Dio] LoginReq cannot be used to imply a default content-type, please set a proper content-type in the request.

error log2:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: DioException [bad response]: This exception was thrown because the response has a status code of 400 and RequestOptions.validateStatus was configured to throw for this status code.
The status code of 400 has the following meaning: "Client error - the request contains bad syntax or cannot be fulfilled"
Read more about status codes at https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
In order to resolve this exception you typically have either to verify and fix your request code or you have to fix the server code.

#0 DioMixin.fetch (package:dio/src/dio_mixin.dart:520:7)

#1 _ApiService.login (package:flutter_retrofit/retrofit/api_service.g.dart:53:21)

#2 RetrofitUtils.login (package:flutter_retrofit/retrofit/retrofit_utils.dart:71:20)

#3 _MyHomePageState.build.. (package:flutter_retrofit/main.dart:82:100)

if use Map<String,dynamic> replace bean to @Body parameter, It's OK

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions