retrofit2.http.Streaming Java Examples

The following examples show how to use retrofit2.http.Streaming. 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: API.java    From Android-SingleSignOn with GNU General Public License v3.0 5 votes vote down vote up
@GET("items/updated")
@Streaming
Observable<ResponseBody> getStreamingUpdatedItems(
        @Query("lastModified") long lastModified,
        @Query("type") int type,
        @Query("id") long id
);
 
Example #2
Source File: RestAttachments.java    From botbuilder-java with MIT License 5 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8",
    "x-ms-logging-context: com.microsoft.bot.schema.Attachments getAttachment" })
@GET("v3/attachments/{attachmentId}/views/{viewId}")
@Streaming
CompletableFuture<Response<ResponseBody>> getAttachment(
    @Path("attachmentId") String attachmentId,
    @Path("viewId") String viewId,
    @Header("accept-language") String acceptLanguage,
    @Header("User-Agent") String userAgent
);
 
Example #3
Source File: HttpDownService.java    From RxRetrofit-mvp with MIT License 4 votes vote down vote up
@Streaming/*大文件需要加入这个判断,防止下载过程中写入到内存中*/
@GET
Observable<ResponseBody> download(@Header("RANGE") String start, @Url String url);
 
Example #4
Source File: JiraEndPoints.java    From jira-steps-plugin with Apache License 2.0 4 votes vote down vote up
@Streaming
@GET
Call<ResponseBody> downloadFileWithDynamicUrl(@Url String fileUrl);
 
Example #5
Source File: HttpDownService.java    From Rx-Retrofit with MIT License 4 votes vote down vote up
@Streaming/*大文件需要加入这个判断,防止下载过程中写入到内存中*/
@GET
Observable<ResponseBody> download(@Header("RANGE") String start, @Url String url);
 
Example #6
Source File: IDownLoadService.java    From easyweather with MIT License 4 votes vote down vote up
@Streaming
@GET
Call<ResponseBody> downloadFile(@Url String fileUrl, @Header("Range") String range);
 
Example #7
Source File: GetAndPostService.java    From AndroidBase with Apache License 2.0 4 votes vote down vote up
@Streaming
@GET("download")
Call<ResponseBody> downloadFile();
 
Example #8
Source File: IDownLoadService.java    From easyweather with MIT License 4 votes vote down vote up
@Streaming
@GET
Call<ResponseBody> getHttpHeader(@Url String fileUrl, @Header("Range") String range);
 
Example #9
Source File: IDownLoadService.java    From easyweather with MIT License 4 votes vote down vote up
@Streaming
@GET
Call<ResponseBody> downloadFile(@Url String fileUrl);
 
Example #10
Source File: RetrofitInterface.java    From android-retrofit-file-download with MIT License 4 votes vote down vote up
@GET("files/Node-Android-Chat.zip")
@Streaming
Call<ResponseBody> downloadFile();
 
Example #11
Source File: MyRetrofitTest.java    From zone-sdk with MIT License 4 votes vote down vote up
@GET
@Streaming
public Call<ResponseBody> down(@Url String url);
 
Example #12
Source File: ZulipServices.java    From zulip-android with Apache License 2.0 4 votes vote down vote up
@Streaming
@Multipart
@POST("v1/user_uploads")
Call<UploadResponse> upload(@Part MultipartBody.Part file);
 
Example #13
Source File: AppliveryTestApi.java    From applivery-android-sdk with Apache License 2.0 4 votes vote down vote up
@Streaming @GET("/download/{build_id}/manifest/{download_token}")
Call<ResponseBody> downloadBuild(@Path("build_id") String buildId, @Path("download_token") String download_token);
 
Example #14
Source File: ArmeriaCallFactoryLargeStreamTest.java    From armeria with Apache License 2.0 4 votes vote down vote up
@Streaming
@GET("/large-stream")
CompletableFuture<ResponseBody> largeStream();
 
Example #15
Source File: AcApi.java    From BlueBoard with Apache License 2.0 4 votes vote down vote up
@GET(AcString.CONTENT_RANK)
@Streaming
Observable<AcReOther> getData(@QueryMap() Map<String, String> options);
 
Example #16
Source File: NextcloudRetrofitServiceMethod.java    From Android-SingleSignOn with GNU General Public License v3.0 4 votes vote down vote up
private void parseMethodAnnotation(Annotation annotation) {
    if (annotation instanceof DELETE) {
        parseHttpMethodAndPath("DELETE", ((DELETE) annotation).value(), false);
    } else if (annotation instanceof GET) {
        parseHttpMethodAndPath("GET", ((GET) annotation).value(), false);
    } else if (annotation instanceof POST) {
        parseHttpMethodAndPath("POST", ((POST) annotation).value(), true);
    } else if (annotation instanceof PUT) {
        parseHttpMethodAndPath("PUT", ((PUT) annotation).value(), true);
    } else if (annotation instanceof HEAD) {
        parseHttpMethodAndPath("HEAD", ((HEAD) annotation).value(), false);
    } else if (annotation instanceof HTTP) {
        HTTP http = (HTTP) annotation;
        parseHttpMethodAndPath(http.method(), http.path(), http.hasBody());
    } else if (annotation instanceof Multipart) {
        if (isFormEncoded) {
            throw methodError(method, "Only one encoding annotation is allowed.");
        }
        isMultipart = true;
    } else if (annotation instanceof FormUrlEncoded) {
        if (isMultipart) {
            throw methodError(method, "Only one encoding annotation is allowed.");
        }
        isFormEncoded = true;
    } else if (annotation instanceof Streaming) {
        Log.v(TAG, "streaming interface");
    } else if (annotation instanceof retrofit2.http.Headers) {
        String[] headersToParse = ((retrofit2.http.Headers) annotation).value();
        if (headersToParse.length == 0) {
            throw methodError(method, "@Headers annotation is empty.");
        }
        headers = parseHeaders(headersToParse);
    } else if(annotation instanceof FormUrlEncoded) {
        //formUrlEncoded = true;
        Log.v(TAG, "FormUrlEncoded request");
    } else if(annotation instanceof NextcloudAPI.FollowRedirects) {
        followRedirects = true;
    } else {
        throw new UnsupportedOperationException(String.valueOf(annotation));
    }
}
 
Example #17
Source File: FileService.java    From VideoMeeting with Apache License 2.0 4 votes vote down vote up
@GET
@Streaming
Call<ResponseBody> download(@Url String url);
 
Example #18
Source File: RetrofitInterface.java    From journaldev with MIT License 4 votes vote down vote up
@Streaming
@GET
Call<ResponseBody> downloadFileByUrl(@Url String fileUrl);
 
Example #19
Source File: RetrofitInterface.java    From journaldev with MIT License 4 votes vote down vote up
@GET()
@Streaming
Call<ResponseBody> downloadImage(@Url String fileUrl);
 
Example #20
Source File: HttpDownService.java    From RxjavaRetrofitDemo-master with MIT License 4 votes vote down vote up
@Streaming/*大文件需要加入这个判断,防止下载过程中写入到内存中*/
@GET
Observable<ResponseBody> download(@Header("RANGE") String start, @Url String url);
 
Example #21
Source File: FreightTrackWebService.java    From ESeal with Apache License 2.0 4 votes vote down vote up
@Streaming
@GET
Observable<Response<ResponseBody>> downloadFile(@Header("Range") String range, @Url String fileUrl);
 
Example #22
Source File: FreightTrackWebService.java    From ESeal with Apache License 2.0 4 votes vote down vote up
/**
 * @description 下载文件
 */
//下载APK文件
@Streaming
@GET
Observable<ResponseBody> downloadFile(@Url String fileUrl);
 
Example #23
Source File: FreightTrackWebService.java    From ESeal with Apache License 2.0 4 votes vote down vote up
@Streaming
@GET
Observable<Response<ResponseBody>> downloadFile(@Header("Range") String range, @Url String fileUrl);
 
Example #24
Source File: FreightTrackWebService.java    From ESeal with Apache License 2.0 4 votes vote down vote up
/**
 * @description 下载文件
 */
//下载APK文件
@Streaming
@GET
Observable<ResponseBody> downloadFile(@Url String fileUrl);
 
Example #25
Source File: HttpDownService.java    From RxjavaRetrofitDemo-string-master with MIT License 4 votes vote down vote up
@Streaming/*大文件需要加入这个判断,防止下载过程中写入到内存中*/
@GET
Observable<ResponseBody> download(@Header("RANGE") String start, @Url String url);
 
Example #26
Source File: RetrofitBuilder.java    From redux-android-sample with Apache License 2.0 4 votes vote down vote up
@GET
@Streaming
Call<ResponseBody> downloadFileWithDynamicUrlSync(@Url String fileUrl);
 
Example #27
Source File: BaseApiService.java    From RetrofitClient with Apache License 2.0 4 votes vote down vote up
@Streaming
@GET
Observable<ResponseBody> downloadFile(@Url String fileUrl);
 
Example #28
Source File: CachedCallTest.java    From retrocache with Apache License 2.0 4 votes vote down vote up
@GET("/")
@Streaming
Cached<ResponseBody> getStreamingBody();
 
Example #29
Source File: ApiService.java    From AndroidModulePattern with Apache License 2.0 4 votes vote down vote up
/**
 * 流式下载,不加这个注解的话,会整个文件字节数组全部加载进内存,可能导致oom
 */
@Streaming
@GET
Call<ResponseBody> download(@Url String fileUrl, @HeaderMap Map<String, String> headers);
 
Example #30
Source File: YoutubeSiteApi.java    From youtube-jextractor with GNU General Public License v2.0 4 votes vote down vote up
@Streaming
@GET
Call<ResponseBody> getStream(@Url String url);