Last active
August 29, 2015 14:20
-
-
Save segfault87/ac0877f1afb3a6f8e19b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RpcObject( | |
method = HttpRequest.Methods.POST, | |
uri = "/post_image", | |
requestSerializer = MultipartFormDataEncoder.class) | |
public class PostImage { | |
// File name is set automatically and MIME type is determined by its extension | |
@RequestBody public File image; | |
} | |
@RpcObject( | |
method = HttpRequest.Methods.POST, | |
uri = "/post_images", | |
requestSerializer = MultipartFormDataEncoder.class) | |
public class PostMultipleImages { | |
// Name is set to images[0], images[1], ... | |
@RequestBody public List<File> images; | |
} | |
@RpcObject( | |
method = HttpRequest.Methods.POST, | |
uri = "/post_something", | |
requestSerializer = MultipartFormDataEncoder.class) | |
public class PostSomething { | |
// Content-Type is set to application/octet-stream in this case | |
@RequestBody public InputStream arbitraryData; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment