Skip to content

Use Fetch API instead of node.js http #40

@incorvia

Description

@incorvia

It appears that the HttpSoftAP.js uses the node.js "http" module. However, this http module is not supported by React Native, leading to the popular tool rn-nodeify. Among other things, in a react-native project, rn-nodeify will install react-native-http, a react-native compatible library that attempts to provide the same http API but in a module that is compatible with react-native. React-Native-HTTP is poorly maintained, so it does not include methods like req.setTimeout which is used in this particularly library making it incompatible.

Facebook uses the Fetch API for maximum compatibility. You can read more about it here. Browsers now also implement this API with only older browsers not supporting it.

The world is converging on fetch..

Cross-Fetch is a library that makes using fetch across all 3 simple. It is certainly nice that softap-setup-js does not have any real dependencies, however, using cross-fetch would make it a lot easier to incorporate this library into react-native. Can we please consider using cross-fetch instead of HTTP so we can have the cross compatibility this library deserves?

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