Created
September 29, 2015 14:46
-
-
Save rcgonzalezf/51f66f4699f223fcfad9 to your computer and use it in GitHub Desktop.
Upload a Video, using Retrofit.
This file contains 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
/* | |
* @author jules | |
* | |
*/ | |
public interface VideoServiceProxy { | |
public static final String DATA_PARAMETER = "data"; | |
public static final String ID_PARAMETER = "id"; | |
public static final String VIDEO_SVC_PATH = "/video"; | |
public static final String VIDEO_DATA_PATH = VIDEO_SVC_PATH + "/{id}/data"; | |
/** | |
* This endpoint allows clients to add Video objects by sending POST requests | |
* that have an application/json body containing the Video object information. | |
* | |
* @return | |
*/ | |
@POST(VIDEO_SVC_PATH) | |
public Video addVideo(@Body Video video); | |
/** | |
* This endpoint allows clients to set the mpeg video data for previously | |
* added Video objects by sending multipart POST requests to the server. | |
* The URL that the POST requests should be sent to includes the ID of the | |
* Video that the data should be associated with (e.g., replace {id} in | |
* the url /video/{id}/data with a valid ID of a video, such as /video/1/data | |
* -- assuming that "1" is a valid ID of a video). | |
* | |
* @return | |
*/ | |
@Multipart | |
@POST(VIDEO_DATA_PATH) | |
public VideoStatus setVideoData(@Path(ID_PARAMETER) long id, @Part(DATA_PARAMETER) TypedFile videoData); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment