Skip to content

Adding a factory method to create a request/response (http package) from a request/response (io package)  #8

Closed
@Pacane

Description

@Pacane

I think it could be cool to be able to create one of these when I'm using another framework that's using io.HttpResponse, I like the Future api you provide.

ie: using redstone.dart

import 'package:http/http.dart' as http;
import 'dart:io';

// this returns an HttpResponse from dart:io
HttpResponse resp = await app.dispatch(req);
// what I'd like to do then
http.HttpResponse myResponse = new http.HttpResponse.fromIoResponse(resp);
// use it ..
String body = await myResponse.body;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions