Skip to main content

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

1use crate::docs::entry::FnEntry;
2
3pub static HTTP_POST: FnEntry = FnEntry {
4    signature: "http_post(url, body, content_type?)",
5    description: "performs an HTTP POST request with the given body, returning `(status, response_body)`",
6    example: r#"
7get std::http::http_post
8
9dec (int, string) resp = result_unwrap(http_post("https://example.com/api", "{}", "application/json"))"#,
10    expected_output: None,
11    returns: "Result[(int, string)]",
12    errors: Some("Err(string) on a transport failure - not on non-2xx status"),
13    see_also: &["http_get", "http_request"],
14    since: Some("v0.1.5"),
15};