[][src]Crate nano_get

This crate provides a basic implementation of the HTTP GET Method. This uses only the standard Rust Library and has no 3rd party dependencies by default.

An example usage is shown below:

use nano_get::get_http;

fn main() {
    let response = get_http("http://dummy.restapiexample.com/api/v1/employees");
    println!("{}", response);
}

A HTTPS version is provided since v0.2.0 that depends on OpenSSL & the Rust OpenSSL wrapper lib. This can be enabled by the "https" feature flag (which is NOT activated by default).

This provides you with the nano_get::get_https method which has the same signature as the standard nano_get::get_http method.

From version 0.2.0, we profide the new unified nano_get::get method which activates the specific version of http/https get, based on the protocol of the URL.

However, please note that the https part still depends on the "https" feature flag (which is NOT activated by default). The nano_get::get falls back on the regular http version, incase the "https" feature flag is not enabled.

An example usage of the unified get is shown below:

use nano_get::get;

fn main() {
    let response = get("http://dummy.restapiexample.com/api/v1/employees");
    println!("{}", response);
}

or, with the "https" feature flag enabled and the OpenSSL library present,

use nano_get::get;

fn main() {
    let response = get("https://www.google.com");
    println!("{}", response);
}

Structs

URL

This is used to represent the various parts of a URL.

Traits

ToUrl

Represents the ability to be made into a URL.

Functions

get

This is a unified function for the HTTP GET method.

get_http

The basic implementation of the HTTP GET method.