retrofit.http.Part Java Examples

The following examples show how to use retrofit.http.Part. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PatrulatrulAPI.java    From patrol-android with GNU General Public License v3.0 6 votes vote down vote up
@Multipart
@Headers({"Content-Type: multipart/form-data",
        "Accept: application/json",
        "Accept-Encoding: gzip, deflate"})
@POST("/api/{userID}/violation/create")
VideoAnswer uploadImage(@Part("photo") TypedFile photo,
                        @EncodedPath("userID") String userID,
                        @Part("latitude") double latitude,
                        @Part("longitude") double longitude);
 
Example #2
Source File: ServerAPI.java    From FlowGeek with GNU General Public License v2.0 5 votes vote down vote up
@Multipart
@POST("/action/api/tweet_pub")
Call<RespResult> publicTweet(
        @Part("uid") RequestBody uid,
        @Part("msg") RequestBody message,
        @Part("img\"; filename=\"image.png\" ") RequestBody image,
        @Part("amr") RequestBody voice);
 
Example #3
Source File: DrupalOAuth2.java    From drupalfit with MIT License 5 votes vote down vote up
@Multipart
@POST("/token")
Observable<Credential> observeToken(
    @Part("client_id") String clientId,
    @Part("client_secret") String clientSecret,
    @Part("grant_type") String grantType,
    @Part("state") String state,
    @Part("username") String username,
    @Part("password") String password
);
 
Example #4
Source File: DrupalOAuth2.java    From drupalfit with MIT License 5 votes vote down vote up
@Multipart
@POST("/token")
Credential token(
    @Part("client_id") String clientId,
    @Part("client_secret") String clientSecret,
    @Part("grant_type") String grantType,
    @Part("state") String state,
    @Part("username") String username,
    @Part("password") String password
);
 
Example #5
Source File: DrupalOAuth2.java    From drupalfit with MIT License 5 votes vote down vote up
/**
 * <pre>
 * curl -k -X POST 'https://example.com/oauth2/token' -d 'grant_type=password&client_id=id&client_secret=secret&state=state&username=foo&password=bar'
 * </pre>
 */
@Multipart
@POST("/token")
void token(
    @Part("client_id") String clientId,
    @Part("client_secret") String clientSecret,
    @Part("grant_type") String grantType,
    @Part("state") String state,
    @Part("username") String username,
    @Part("password") String password,
    Callback<Credential> callback
);
 
Example #6
Source File: DrupalOAuth2.java    From drupalfit with MIT License 5 votes vote down vote up
@Multipart
@POST("/token")
Observable<Credential> observeToken(
    @Part("code") String code,
    @Part("client_id") String clientId,
    @Part("client_secret") String clientSecret,
    @Part("grant_type") String grantType,
    @Part("state") String state
);
 
Example #7
Source File: DrupalOAuth2.java    From drupalfit with MIT License 5 votes vote down vote up
@Multipart
@POST("/token")
Credential token(
    @Part("code") String code,
    @Part("client_id") String clientId,
    @Part("client_secret") String clientSecret,
    @Part("grant_type") String grantType,
    @Part("state") String state
);
 
Example #8
Source File: DrupalOAuth2.java    From drupalfit with MIT License 5 votes vote down vote up
/**
 * <pre>
 * curl -k -X POST 'https://example.com/oauth2/token' -d 'code=aa5b25e58cb0ecbb1ddf5d671e769b04cabcdefg&state=8tory&grant_type=authorization_code&client_id=id&client_secret=secret'
 * </pre>
 */
@Multipart
@POST("/token")
void token(
    @Part("code") String code,
    @Part("client_id") String clientId,
    @Part("client_secret") String clientSecret,
    @Part("grant_type") String grantType,
    @Part("state") String state,
    Callback<Credential> callback
);
 
Example #9
Source File: RestApiInterface.java    From UPPlatform_Android_SDK with Apache License 2.0 5 votes vote down vote up
@Multipart
@POST("/nudge/api/{version}/users/@me/refreshToken")
void getRefreshToken(
        @Path(UpPlatformSdkConstants.API_VERSION) String version,
        @Part("secret") String clientSecret,
        Callback<Object> response
);
 
Example #10
Source File: ApiDefs.java    From spark-sdk-android with Apache License 2.0 4 votes vote down vote up
@Multipart
@PUT("/v1/devices/{deviceID}")
Response flashFile(@Path("deviceID") String deviceID,
                   @Part("file") TypedOutput file);
 
Example #11
Source File: VideoSvcApi.java    From mobilecloud-15 with Apache License 2.0 4 votes vote down vote up
@Multipart
@POST(VIDEO_DATA_PATH)
public VideoStatus setVideoData(@Path(ID_PARAMETER) long id, @Part(DATA_PARAMETER) TypedFile videoData);
 
Example #12
Source File: HockeyApp.java    From foam with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Multipart
@POST("/api/2/apps/{APP_ID}/crashes/upload")
void createEvent(@Path("APP_ID") String appId,
                 @Part("log") TypedFile log,
                 Callback<Response> callback
);
 
Example #13
Source File: ApiService.java    From droidddle with Apache License 2.0 4 votes vote down vote up
@Multipart
@POST("/shots")
Observable<Response> createShot(@Part("image") TypedFile image, @Part("title") TypedString title, @Part("description") TypedString description, @Part("tags") TypedString tags);
 
Example #14
Source File: ApiService.java    From droidddle with Apache License 2.0 4 votes vote down vote up
@Multipart
@POST("/shots")
Observable<Response> createShot(@Part("image") TypedFile image, @Part("title") TypedString title, @Part("description") TypedString description);
 
Example #15
Source File: ApiService.java    From droidddle with Apache License 2.0 4 votes vote down vote up
@Multipart
@POST("/shots/{id}/attachments")
Observable<Response> createShotAttachments(@Path("id") long id, @Part("file") TypedFile file);
 
Example #16
Source File: UploadApi.java    From talk-android with MIT License 4 votes vote down vote up
@Multipart
@POST("/upload")
Observable<FileUploadResponseData> uploadFile(@Part("name") String name, @Part("type") String mimeType, @Part("size") long fileSize, @Part("file") TypedFile file);
 
Example #17
Source File: VideoSvcApi.java    From mobilecloud-15 with Apache License 2.0 2 votes vote down vote up
/**
 * 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);
 
Example #18
Source File: VideoServiceProxy.java    From mobilecloud-15 with Apache License 2.0 2 votes vote down vote up
/**
 * Sends a POST request to Upload the Video data to the Video Web
 * service using a two-way Retrofit RPC call.  @Multipart is used
 * to transfer multiple content (i.e. several files in case of a
 * file upload to a server) within one request entity.  When doing
 * so, a REST client can save the overhead of sending a sequence
 * of single requests to the server, thereby reducing network
 * latency.
 * 
 * @param id
 * @param videoData
 * @return videoStatus indicating status of the uploaded video.
 */
@Multipart
@POST(VIDEO_DATA_PATH)
public VideoStatus setVideoData(@Path(ID_PARAMETER) long id,
                                @Part(DATA_PARAMETER) TypedFile videoData);