[−][src]Crate idcurl
An idiomatic synchronous Rust library for making HTTP requests.
It's implemented in terms of curl.
Example
let mut output = vec!(); idcurl::get("http://example.com") .expect("error making request") .copy_to(&mut output) .unwrap();
let body = r#"{ "hello": "world" }"#; let mut response = idcurl::Request::post( "http://example.com".to_string() ) .header("Content-Type", "application/json") .body(std::io::Cursor::new(body)) .send() .expect("http request"); assert!(response.status().is_success()); std::io::copy(&mut response, &mut std::io::stdout()) .expect("reading response");
Modules
header |
Structs
Error | |
InvalidStatusCode | A possible error value when converting a |
Request | Represent an unsent query. |
Response | Represents the result of an HTTP request |
StatusCode | An HTTP status code ( |
Enums
Kind | Specifies the type of error |
Method | Specify the HTTP method to use |
Functions
get | Make a basic http GET request to the given URL |
init | Initializes the underlying libcurl library. |
post | Sends an http POST request to the given URL. |
put | Sends an http PUT request to the given URL. |
Type Definitions
Result |