1
0
Fork 0
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:
Dominic 2020-04-20 22:34:39 +02:00
parent 8834f3f64b
commit b6006797f4
Signed by: msrd0
GPG key ID: DCC8C247452E98F9

View file

@ -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)
}
```