Crates.io | austenite |
lib.rs | austenite |
version | 0.0.1 |
source | src |
created_at | 2015-02-09 18:18:38.088155 |
updated_at | 2015-12-11 23:57:49.028558 |
description | HTTP endpoint library for header processing and content negotiation |
homepage | |
repository | https://github.com/hugoduncan/austenite |
max_upload_size | |
id | 1366 |
size | 63,214 |
A library for building Iron handlers that implements HTTP header handling and content negotiation.
A port of Clojure's Liberator library, itself inspired by Erlang's webmachine.
Add austenite = "*"
to your Cargo.toml
dependencies.
struct GetOkContent;
resource_handler!(GetOkContent);
impl Resource for GetOkContent {
fn handle_ok(&self, req: &Request, resp: &mut Response)
-> IronResult<Response>
{
resp.set_mut((status::Ok, "hello"));
Ok(Response::new())
}
}
…
Iron::new(Resource).listen((address,0u16));
…
Copyright 2015 Hugo Duncan
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.