Neutral, Plus or Minus

    @fruitsjs/http
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.1 • Public • Published

    @fruitsjs/http

    Generic HTTP client that is used as a network provider for @fruitsjs/core.

    Installation

    @fruitsjs/http can be used with NodeJS or Web.

    Using with NodeJS and/or modern web frameworks

    Install using npm:

    npm install @fruitsjs/http
    

    or using yarn:

    yarn add @fruitsjs/http
    

    Example

    import {HttpImpl} from '@fruitsjs/http'
    
    async function getTodos() {
        try{
            const client = new HttpClientFactory.createHttpClient('https://jsonplaceholder.typicode.com/');
            const result = await client.get('/todos/1')
            console.log(result)
        }
        catch(httpError){
            console.error(httpError.message)
        }
    }

    Install

    npm i @fruitsjs/http

    DownloadsWeekly Downloads

    14

    Version

    1.1.1

    License

    Apache-2.0

    Unpacked Size

    251 kB

    Total Files

    48

    Last publish

    Collaborators

    • fruits-eco-blockchain