1.0.12 • Published 1 month ago

@turajs/http v1.0.12

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 month ago

@turajs/http

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

Installation

@turajs/http can be used with NodeJS or Web. Two formats are available

Using with NodeJS and/or modern web frameworks

Install using npm:

npm install @turajs/http

or using yarn:

yarn add @turajs/http

Example

import {HttpImpl} from '@turajs/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)
    }
}

Using in classic <script>

Each package is available as bundled standalone library using UMD. This way signumJS can be used also within <script>-Tags. This might be useful for Wordpress and/or other PHP applications.

Just import the package using the HTML <script> tag.

<script src='https://cdn.jsdelivr.net/npm/@turajs/http/dist/signumjs.http.min.js'></script>

Example

const {HttpClientFactory} = sig$http
const client = new HttpClientFactory.createHttpClient('https://jsonplaceholder.typicode.com/');
client.get('/todos/1').then(console.log)

See more here:

@turajs/http Online Documentation

1.0.11

1 month ago

1.0.12

1 month ago

1.0.9

1 month ago

1.0.8

1 month ago

1.0.7

1 month ago

1.0.6

1 month ago

1.0.5

1 month ago

1.0.4

1 month ago