Skip to content

Http API

English API reference for the http family.

This page is the primary owner for the namespaces listed below. Method names, parameter keys, and return fields follow the C++ RegisterApi handlers.

http

http.abort

Public API method. Runtime authority: src/api/HttpApi.cpp:1531.

ParameterTypeRequiredDescription
requestIdstringNoOptional; default .

Returns: {"cancelled":"...","error":"...","requestId":"...","success":true}

js
const result = await fb2k.invoke('http.abort', { requestId: /* value */ });

http.delete

Public API method. Runtime authority: src/api/HttpApi.cpp:1525.

ParameterTypeRequiredDescription
urlstringNoOptional; default .
bodyjsonNoOptional; default omitted.
headersobjectNoOptional; default {}.
timeoutintegerNoOptional; default 30000.
asyncbooleanNoOptional; default true.
redirectstringNoOptional; default follow.
responseTypestringNoOptional; default text.
insecureTlsbooleanNoOptional; default false.

Returns: {"async":"...","error":"...","requestId":"...","success":true}

js
const result = await fb2k.invoke('http.delete', { async: /* value */, body: /* value */, headers: /* value */, insecureTls: /* value */, redirect: /* value */, responseType: /* value */, timeout: /* value */, url: /* value */ });

http.download

Public API method. Runtime authority: src/api/HttpApi.cpp:1519.

ParameterTypeRequiredDescription
asyncbooleanNoOptional; default false.
headersobjectNoOptional; default omitted.
insecureTlsbooleanNoOptional; default false.
redirectstringNoOptional; default follow.
saveTostringNoOptional; default .
timeoutintegerNoOptional; default 60000.
urlstringNoOptional; default .

Returns: {"async":"...","code":"...","error":"...","message":"...","requestId":"...","success":true}

js
const result = await fb2k.invoke('http.download', { async: /* value */, headers: /* value */, insecureTls: /* value */, redirect: /* value */, saveTo: /* value */, timeout: /* value */, url: /* value */ });

http.get

Public API method. Runtime authority: src/api/HttpApi.cpp:1510.

ParameterTypeRequiredDescription
asyncbooleanNoOptional; default true.
headersobjectNoOptional; default omitted.
insecureTlsbooleanNoOptional; default false.
redirectstringNoOptional; default follow.
responseTypestringNoOptional; default text.
timeoutintegerNoOptional; default 30000.
urlstringNoOptional; default .

Returns: {"async":"...","error":"...","requestId":"...","success":true}

js
const result = await fb2k.invoke('http.get', { async: /* value */, headers: /* value */, insecureTls: /* value */, redirect: /* value */, responseType: /* value */, timeout: /* value */, url: /* value */ });

http.head

Public API method. Runtime authority: src/api/HttpApi.cpp:1516.

ParameterTypeRequiredDescription
asyncbooleanNoOptional; default true.
headersobjectNoOptional; default omitted.
insecureTlsbooleanNoOptional; default false.
redirectstringNoOptional; default follow.
timeoutintegerNoOptional; default 30000.
urlstringNoOptional; default .

Returns: {"async":"...","contentLength":"...","requestId":"...","success":true}

js
const result = await fb2k.invoke('http.head', { async: /* value */, headers: /* value */, insecureTls: /* value */, redirect: /* value */, timeout: /* value */, url: /* value */ });

http.patch

Public API method. Runtime authority: src/api/HttpApi.cpp:1528.

ParameterTypeRequiredDescription
urlstringNoOptional; default .
bodyjsonNoOptional; default omitted.
headersobjectNoOptional; default {}.
timeoutintegerNoOptional; default 30000.
asyncbooleanNoOptional; default true.
redirectstringNoOptional; default follow.
responseTypestringNoOptional; default text.
insecureTlsbooleanNoOptional; default false.

Returns: {"async":"...","error":"...","requestId":"...","success":true}

js
const result = await fb2k.invoke('http.patch', { async: /* value */, body: /* value */, headers: /* value */, insecureTls: /* value */, redirect: /* value */, responseType: /* value */, timeout: /* value */, url: /* value */ });

http.post

Public API method. Runtime authority: src/api/HttpApi.cpp:1513.

ParameterTypeRequiredDescription
urlstringNoOptional; default .
bodyjsonNoOptional; default omitted.
headersobjectNoOptional; default {}.
timeoutintegerNoOptional; default 30000.
asyncbooleanNoOptional; default true.
redirectstringNoOptional; default follow.
responseTypestringNoOptional; default text.
insecureTlsbooleanNoOptional; default false.

Returns: {"async":"...","error":"...","requestId":"...","success":true}

js
const result = await fb2k.invoke('http.post', { async: /* value */, body: /* value */, headers: /* value */, insecureTls: /* value */, redirect: /* value */, responseType: /* value */, timeout: /* value */, url: /* value */ });

http.put

Public API method. Runtime authority: src/api/HttpApi.cpp:1522.

ParameterTypeRequiredDescription
urlstringNoOptional; default .
bodyjsonNoOptional; default omitted.
headersobjectNoOptional; default {}.
timeoutintegerNoOptional; default 30000.
asyncbooleanNoOptional; default true.
redirectstringNoOptional; default follow.
responseTypestringNoOptional; default text.
insecureTlsbooleanNoOptional; default false.

Returns: {"async":"...","error":"...","requestId":"...","success":true}

js
const result = await fb2k.invoke('http.put', { async: /* value */, body: /* value */, headers: /* value */, insecureTls: /* value */, redirect: /* value */, responseType: /* value */, timeout: /* value */, url: /* value */ });

Contract supplements

The sections below close public-contract findings from the strict parameter audit without replacing existing explanations.

Contract supplement: http.delete

Verified contract supplement. Runtime authority: src/api/HttpApi.cpp:1396-1432.

ParameterTypeRequiredDefaultDescription
urlstringNo``Optional; default .
bodyjsonNoomittedOptional; default omitted.
headersobjectNo{}Optional; default {}.
timeoutintegerNo30000Optional; default 30000.
asyncbooleanNotrueOptional; default true.
redirectstringNofollowOptional; default follow.
responseTypestringNotextOptional; default text.
insecureTlsbooleanNofalseOptional; default false.

Return fields

FieldTypeOptional
errorstringYes
successbooleanNo
asyncjsonNo
requestIdjsonNo

Semantics: omitted optional parameters use handler defaults; failure branches and error fields are defined by this source file.

js
const result = await fb2k.invoke('http.delete', { url: /* value */, body: /* value */, headers: /* value */, timeout: /* value */, async: /* value */, redirect: /* value */, responseType: /* value */, insecureTls: /* value */ });

Contract supplement: http.download

Verified contract supplement. Runtime authority: src/api/HttpApi.cpp:1237-1352.

ParameterTypeRequiredDefaultDescription
asyncbooleanNofalseOptional; default false.
headersobjectNoomittedOptional; default omitted.
insecureTlsbooleanNofalseOptional; default false.
redirectstringNofollowOptional; default follow.
saveTostringNo``Optional; default .
timeoutintegerNo60000Optional; default 60000.
urlstringNo``Optional; default .

Return fields

FieldTypeOptional
errorstringYes
successbooleanNo
codestringYes
asyncjsonNo
messagejsonNo
requestIdjsonNo

Semantics: omitted optional parameters use handler defaults; failure branches and error fields are defined by this source file.

js
const result = await fb2k.invoke('http.download', { async: /* value */, headers: /* value */, insecureTls: /* value */, redirect: /* value */, saveTo: /* value */, timeout: /* value */, url: /* value */ });

Contract supplement: http.get

Verified contract supplement. Runtime authority: src/api/HttpApi.cpp:822-862.

ParameterTypeRequiredDefaultDescription
asyncbooleanNotrueOptional; default true.
headersobjectNoomittedOptional; default omitted.
insecureTlsbooleanNofalseOptional; default false.
redirectstringNofollowOptional; default follow.
responseTypestringNotextOptional; default text.
timeoutintegerNo30000Optional; default 30000.
urlstringNo``Optional; default .

Return fields

FieldTypeOptional
errorstringYes
successbooleanNo
asyncjsonNo
requestIdjsonNo

Semantics: omitted optional parameters use handler defaults; failure branches and error fields are defined by this source file.

js
const result = await fb2k.invoke('http.get', { async: /* value */, headers: /* value */, insecureTls: /* value */, redirect: /* value */, responseType: /* value */, timeout: /* value */, url: /* value */ });

Contract supplement: http.head

Verified contract supplement. Runtime authority: src/api/HttpApi.cpp:906-950.

ParameterTypeRequiredDefaultDescription
asyncbooleanNotrueOptional; default true.
headersobjectNoomittedOptional; default omitted.
insecureTlsbooleanNofalseOptional; default false.
redirectstringNofollowOptional; default follow.
timeoutintegerNo30000Optional; default 30000.
urlstringNo``Optional; default .

Return fields

FieldTypeOptional
errorstringYes
successbooleanNo
asyncjsonNo
requestIdjsonNo

Semantics: omitted optional parameters use handler defaults; failure branches and error fields are defined by this source file.

js
const result = await fb2k.invoke('http.head', { async: /* value */, headers: /* value */, insecureTls: /* value */, redirect: /* value */, timeout: /* value */, url: /* value */ });

Contract supplement: http.patch

Verified contract supplement. Runtime authority: src/api/HttpApi.cpp:1436-1472.

ParameterTypeRequiredDefaultDescription
urlstringNo``Optional; default .
bodyjsonNoomittedOptional; default omitted.
headersobjectNo{}Optional; default {}.
timeoutintegerNo30000Optional; default 30000.
asyncbooleanNotrueOptional; default true.
redirectstringNofollowOptional; default follow.
responseTypestringNotextOptional; default text.
insecureTlsbooleanNofalseOptional; default false.

Return fields

FieldTypeOptional
errorstringYes
successbooleanNo
asyncjsonNo
requestIdjsonNo

Semantics: omitted optional parameters use handler defaults; failure branches and error fields are defined by this source file.

js
const result = await fb2k.invoke('http.patch', { url: /* value */, body: /* value */, headers: /* value */, timeout: /* value */, async: /* value */, redirect: /* value */, responseType: /* value */, insecureTls: /* value */ });

Contract supplement: http.post

Verified contract supplement. Runtime authority: src/api/HttpApi.cpp:866-902.

ParameterTypeRequiredDefaultDescription
urlstringNo``Optional; default .
bodyjsonNoomittedOptional; default omitted.
headersobjectNo{}Optional; default {}.
timeoutintegerNo30000Optional; default 30000.
asyncbooleanNotrueOptional; default true.
redirectstringNofollowOptional; default follow.
responseTypestringNotextOptional; default text.
insecureTlsbooleanNofalseOptional; default false.

Return fields

FieldTypeOptional
errorstringYes
successbooleanNo
asyncjsonNo
requestIdjsonNo

Semantics: omitted optional parameters use handler defaults; failure branches and error fields are defined by this source file.

js
const result = await fb2k.invoke('http.post', { url: /* value */, body: /* value */, headers: /* value */, timeout: /* value */, async: /* value */, redirect: /* value */, responseType: /* value */, insecureTls: /* value */ });

Contract supplement: http.put

Verified contract supplement. Runtime authority: src/api/HttpApi.cpp:1356-1392.

ParameterTypeRequiredDefaultDescription
urlstringNo``Optional; default .
bodyjsonNoomittedOptional; default omitted.
headersobjectNo{}Optional; default {}.
timeoutintegerNo30000Optional; default 30000.
asyncbooleanNotrueOptional; default true.
redirectstringNofollowOptional; default follow.
responseTypestringNotextOptional; default text.
insecureTlsbooleanNofalseOptional; default false.

Return fields

FieldTypeOptional
errorstringYes
successbooleanNo
asyncjsonNo
requestIdjsonNo

Semantics: omitted optional parameters use handler defaults; failure branches and error fields are defined by this source file.

js
const result = await fb2k.invoke('http.put', { url: /* value */, body: /* value */, headers: /* value */, timeout: /* value */, async: /* value */, redirect: /* value */, responseType: /* value */, insecureTls: /* value */ });

Request lifecycle and security

  • http.get, http.post, http.put, http.delete, http.patch, and http.head default to asynchronous execution. Their immediate success: true response means only that dispatch succeeded and contains requestId; it is not the HTTP result. Final results are sent to the invoking window as http:response and must be correlated by requestId.
  • The SDK fb.http.request() helper waits for the matching completion event; use it when application code needs an awaited final result without manually subscribing to http:response.
  • The SDK convenience call fb.http.get( is a facade over the same invoke contract and may decode binary response bodies for its caller.
  • For synchronous execution, pass async: false. Successful non-download responses include status, headers, body, and responseType. A successful synchronous or asynchronous HEAD response may additionally include numeric contentLength when the response exposes Content-Length.
  • http.download defaults to synchronous execution. With async: true, its final result is emitted as http:downloadComplete with requestId; http.abort requests cancellation of an active asynchronous request.
  • Only http and https URLs are accepted. Private or local-network destinations are denied unless the host's Advanced Settings permits them; redirects are checked again at every hop and the redirect limit is 10.
  • insecureTls: true takes effect only when the caller opts in and the host's invalid-certificate setting is enabled. This bypass is unsuitable for public Internet traffic.
  • Response bodies are limited to 100 MB and downloads to 500 MB. http.download.saveTo is a write-protected path parameter and is subject to the Bridge security policy.