小编Abd*_*idi的帖子

发送 post 请求时,类型“int”不是类型转换中“String”类型的子类型

发送帖子请求时出现奇怪的错误。

// this map is passed to a function
final Map<String, dynamic> activityData = {
  "userId": 1,
  "name": activityName.text,
  "description": activityDescription.text,
  "startAt": activityStartAt.text,
  "endsAt": activityEndAt.text,
  "lat": _latitude,
  "long": _longitude,
  "category": 2,
  "status": "pending"
};

// this code bellow is inside a async function
final http.Response response =
        await http.post(Uri.encodeFull(url), body: activityData);
Run Code Online (Sandbox Code Playgroud)

这是错误:

E/flutter (32582): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception:
E/flutter (32582): type 'int' is not a subtype of type 'String' in type cast
E/flutter (32582): #0      CastMap.forEach.<anonymous closure> (dart:_internal/cast.dart:286:25)
E/flutter …
Run Code Online (Sandbox Code Playgroud)

post http-post flutter

11
推荐指数
2
解决办法
1万
查看次数

如何从我的ubuntu-16.04服务器中删除redis

我跑的时候sudo systemctl status redis得到这个

? redis.service - Redis In-Memory Data Store
Loaded: loaded (/etc/systemd/system/redis.service; enabled; vendor preset: 
enabled)
Active: inactive (dead) (Result: exit-code) since Thu 2017-05-11 03:43:43 
WEST; 
31min ago
Main PID: 1553 (code=exited, status=203/EXEC)

May 11 03:43:42 fevrok systemd[1]: redis.service: Control process exited, 
code=exited status=203
May 11 03:43:42 fevrok systemd[1]: redis.service: Unit entered failed state.
May 11 03:43:42 fevrok systemd[1]: redis.service: Failed with result 'exit-code'.
May 11 03:43:43 fevrok systemd[1]: redis.service: Service hold-off time over, scheduling restart. …
Run Code Online (Sandbox Code Playgroud)

ubuntu ubuntu-server redis ubuntu-16.04

2
推荐指数
1
解决办法
9350
查看次数

标签 统计

flutter ×1

http-post ×1

post ×1

redis ×1

ubuntu ×1

ubuntu-16.04 ×1

ubuntu-server ×1