post NET
¶
Requires network
permission. For more information click here.
post API is a shorthand way of making POST API calls.
Syntax¶
post(url: String, body: object, headers?: object) : Promise<object>
Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | import INKAPI from './inkapi.js'
INKAPI.ready(() => {
const NET = INKAPI.net;
// making POST request
const body = { someKey: "Some Data" }
NET.post("https://jsonplaceholder.typicode.com/posts/1", body)
.then((data)=>{
console.log(data);
});
});
|
Parameters¶
Name |
Type |
Description |
---|---|---|
url |
|
Required. API endpoint to make network calls. |
body |
|
Required. Contains data to send from a client to the API. |
headers |
|
Add headers to your API call. |