Rust
Rust
Send a REST Request with No Body
See more REST Examples
Demonstrates Rest.FullRequestNoBody, which sends a complete request with no request body (such as a GET or DELETE) and returns the response body as text.
Background. This is the simplest full-request convenience method, ideal for retrieval and deletion calls that carry no request payload.
Chilkat Rust Downloads
let rest = chilkat::Rest::new();
let b_tls = true;
let b_auto_reconnect = true;
if rest.connect("example.com", 443, b_tls, b_auto_reconnect).is_err() {
println!("{}", rest.last_error_text());
return;
}
// Send a complete request with no request body, such as a GET or DELETE. The response body is read
// as text and returned.
let Ok(response_text) = rest.full_request_no_body("GET", "/api/items/123") else {
println!("{}", rest.last_error_text());
return;
};
println!("{}", response_text);