mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-02-22 20:52:27 +00:00
update readme
This commit is contained in:
parent
8834f3f64b
commit
b6006797f4
1 changed files with 5 additions and 2 deletions
|
@ -78,11 +78,14 @@ struct ImageResource;
|
|||
|
||||
#[derive(FromBody, RequestBody)]
|
||||
#[supported_types(mime::IMAGE_GIF, mime::IMAGE_JPEG, mime::IMAGE_PNG)]
|
||||
struct RawImage(Vec<u8>);
|
||||
struct RawImage {
|
||||
content: Vec<u8>,
|
||||
content_type: Mime
|
||||
}
|
||||
|
||||
#[rest_create(ImageResource)]
|
||||
fn create(_state : &mut State, body : RawImage) -> Raw<Vec<u8>> {
|
||||
Raw::new(body.0, mime::APPLICATION_OCTET_STREAM)
|
||||
Raw::new(body.content, body.content_type)
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue