Roy
A high-level library for consuming RESTful APIs.
Table of Contents
Documentation
Installation
Add this to your Cargo.toml:
[]
= "0.1"
Usage
To use any of the methods on the roy::Client struct, it has to be instantiated as follows:
// import into scope
use Client;
// Instantiate `Client` with your API's base URL
let c = new;
All of the examples below assume that the struct has already been instantiated.
GET
c.get; // Make a GET request to your endpoint
POST
c.post; // Make a POST request to your endpoint
PATCH
c.patch; // Make a PATCH request to your endpoint
PUT
c.put; // Make a PUT request to your endpoint
DELETE
c.delete; // Make a DELETE request to your endpoint
License
Roy is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE-APACHE and LICENSE-MIT, and COPYRIGHT for details.
Behind the Name
This crate is named after Roy Fielding, who defined Representational State Transfer. According to Wikipedia:
Roy Fielding defined REST in his 2000 PhD dissertation "Architectural Styles and the Design of Network-based Software Architectures" at UC Irvine. He developed the REST architectural style in parallel with HTTP 1.1 of 1996–1999, based on the existing design of HTTP 1.0 of 1996.