Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教下这种图片返回的数据如何放在flutter里面显示? #59

Closed
sidealice opened this issue Sep 3, 2018 · 3 comments
Closed

Comments

@sidealice
Copy link

https://login.sina.com.cn/cgi/pin.php?r=

没有找到image可以设置data的。不知道有没有解决方案?

Options options = Options(
  responseType: ResponseType.STREAM,
  contentType: ContentType.parse('image/png'),
  method: 'get',
  headers: headers,
);
Response<dynamic> response = await dio.get(
  url,
  options: options,
);

这种方式是对的吗?

@sidealice
Copy link
Author

已经解决。抱歉这个问题和dio没关系。

@w4mxl
Copy link

w4mxl commented Jan 4, 2019

已经解决。抱歉这个问题和dio没关系。

@sidealice 请问能说一下是如何解决的吗?

-> 我目前是通过consolidateHttpClientResponseBytes解决的

@LoveRain1997
Copy link

这样写就行
static Future getCaptchaByMobile(String mobile) async {

Options options = Options(
  responseType: ResponseType.stream,
);

Response   response = await http
    .get(Urls.GetCaptchaByMobile, queryParameters: {"mobile": mobile},options: options);
ResponseBody resp = response.data;

return resp.stream.first;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants