테마
bm.call()
- HTTP 요청을 보낼 때 사용할 수 있어요.
bm.call(request)형식으로 사용하며Promise를 반환해요.- 기본적으로
bm.call()은 JSON으로 데이터를 전송(Content-Type: application/json)해요.
jsx
<script>
// GET 요청 예시
bm.call({
method: 'GET',
url: 'https://example.org/cats'
}).then(response => {
bm.context.cats = response.data;
bm.apply();
});
// POST 요청 예시
bm.call({
method: 'POST',
url: 'https://example.org/dogs',
data: {
name: '블로키'
}
}).then(response => {
console.log(response.data);
});
</script>