Skip to main content

cloudrun

Cloud hosting

callContainer

callContainer(object: Object): Promise<Object>

1. API Description

API feature: Call the cloud hosting service.

2. Input Parameters

object
Object

3. Output Parameters

Service execution error, exception thrown

Promise
Object

4. Example code

import cloudbase from "@cloudbase/js-sdk";

// Initialize an SDK instance
const app = cloudbase.init({
env: "xxxx-yyy",
});

app
.callContainer({
name: "helloworld",
method: "POST",
path: "/abc",
header: {
"Content-Type": "application/json; charset=utf-8",
},
data: {
key1: "test value 1",
key2: "test value 2",
},
})
.then((res) => {
console.log(res);
});