Skip to main content

do_http_request

Function do_http_request 

Source
pub(crate) fn do_http_request(
    base: &str,
    url: &str,
    method: &str,
    body: &str,
    content_type: &str,
) -> Result<(u16, String), &'static str>
Expand description

同期 HTTP リクエストの共通処理。(status, body) を返す。data:http(s): 対応(fetch/XHR 共有)。 base が非空なら相対URLを解決。method は GET/POST/PUT/DELETE/PATCH/HEAD 等を任意に通す (web_request 内で英大文字トークン検証)。