get NET

Requires network permission. For more information click here.

get API is a shorthand way of making GET API calls.

Syntax

get(url: String, headers?: object) : Promise<object>

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import INKAPI from './inkapi.js'

INKAPI.ready(() => {

  const NET = INKAPI.net;

  // making GET request

  NET.get("https://jsonplaceholder.typicode.com/posts/1").then((data)=>{
    console.log(data);
  });

});

Parameters

Name

Type

Description

url

String

Required. API endpoint to make network calls.

headers

object

Add headers to your API call.