我正在处理 http 请求。突然,根据我的请求,我收到的响应状态代码为“200”,以便我的 api 正常工作。但是,根据我的响应正文,返回不完整。顺便说一下,这是我使用的资源。
String APILink = "http://10.12.50.46:9191";
String compressedString2;
Future<SuccessData> getSession() async {
http.Response response2=await http.post(
Uri.encodeFull(APILink+"/Mobile/StartSession"),
headers:{
"Auth-Key":"InSys-dev-key-001 ",
},body:compressedString2,
);
print("Compressed JSON:"+compressedString2);
print(response2.statusCode);
var dataGather2 = json.decode(response2.body);
print(response2.body);
}
Run Code Online (Sandbox Code Playgroud)
这是我使用 insomnia (Rest API) 时的实际反应
这是我在 logcat 上的打印数据:
如果您注意到,我在“ResultSet”上的返回数据不完整。其他数据也确实会被获取,例如状态、错误消息,并且标签不会被查看。
我正在尝试在我的应用程序上获取当前日期时间,但突然间,方法“DateFormat”未在我的应用程序上同步,即使我在顶部添加了导入库。此外,如果您将鼠标悬停在错误“DateFormat”上,它正在创建新类..因为它在我的应用程序中无法识别。
这是我的代码:
import 'dart:core';
import 'package:flutter/material.dart';
import 'package:intl/intl_browser.dart';
class LabelTextID extends StatelessWidget {
@override
Widget build(BuildContext context) {
var now = new DateTime.now();
var formatter = new DateFormat('yyyy-MM-dd');
String formatted = formatter.format(now);
return Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
width: 130,
height: 40.0,
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Text(
"ID",
style: TextStyle(
fontSize: 26.0, color: Colors.black54),
),
),
),
Expanded(
child: Container(
height: 40.0,
decoration:new BoxDecoration(
),
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Text(
"12",
style: …Run Code Online (Sandbox Code Playgroud)