Skip to main content

rl_lang/docs/entries/stdlib/http/
http_get.rs

1use crate::docs::entry::FnEntry;
2
3pub static HTTP_GET: FnEntry = FnEntry {
4    signature: "http_get(url)",
5    description: "performs an HTTP GET request, returning `(status, body)`; non-2xx statuses are still a successful result, not an error",
6    example: r#"
7get std::http::http_get
8
9dec (int, string) resp = result_unwrap(http_get("https://example.com"))"#,
10    expected_output: None,
11    returns: "Result[(int, string)]",
12    errors: Some(
13        "Err(string) on a transport failure (DNS, connection, timeout) - not on non-2xx status",
14    ),
15    see_also: &["http_post", "http_request"],
16    since: Some("v0.1.5"),
17};