retrofit2.http.Query类的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(9.4k)|赞(0)|评价(0)|浏览(236)

本文整理了Java中retrofit2.http.Query类的一些代码示例,展示了Query类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query类的具体详情如下:
包路径:retrofit2.http.Query
类名称:Query

Query介绍

暂无

代码示例

代码示例来源:origin: smuyyh/BookReader

/**
 * 获取书评区、书荒区帖子详情内的评论列表
 *
 * @param bookReviewId->_id
 * @param start             0
 * @param limit             30
 * @return
 */
@GET("/post/review/{bookReviewId}/comment")
Observable<CommentList> getBookReviewComments(@Path("bookReviewId") String bookReviewId, @Query("start") String start, @Query("limit") String limit);

代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources

@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.Resources list" })
@GET("subscriptions/{subscriptionId}/resources")
Observable<Response<ResponseBody>> list(@Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$expand") String expand, @Query("$top") Integer top, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

代码示例来源:origin: com.microsoft.azure/azure-mgmt-storage

@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.StorageAccounts checkNameAvailability" })
@POST("subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability")
Observable<Response<ResponseBody>> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StorageAccountCheckNameAvailabilityParameters accountName, @Header("User-Agent") String userAgent);

代码示例来源:origin: JakeWharton/u2020

@GET("search/repositories") //
 Observable<Result<RepositoriesResponse>> repositories( //
   @Query("q") SearchQuery query, //
   @Query("sort") Sort sort, //
   @Query("order") Order order);
}

代码示例来源:origin: iMeiji/Toutiao

/**
 * 获取新闻标题等信息 部分请求参数不同上
 * "http://toutiao.com/api/article/recent/?source=2&category=类型&as=A105177907376A5&cp=5797C7865AD54E1&_=时间&count=30";
 */
@GET("api/article/recent/?source=2&as=A1F519007D6B4BB&cp=590D4B541BBB1E1")
@Headers({
    "User-Agent:" + Constant.USER_AGENT_PC,
    "X-Requested-With:XMLHttpRequest"
})
Call<ResponseBody> getNewsArticle2(
    @Query("category") String category,
    @Query("_") int max_behot_time);

代码示例来源:origin: ribot/ribot-app-android

@GET("ribots")
Observable<List<Ribot>> getRibots(@Header(AUTH_HEADER) String authorization,
                 @Query("embed") String embed);

代码示例来源:origin: allure-framework/allure2

@PUT("raven/1.0/api/testrun/{id}/status")
Response<ResponseBody> updateTestRunStatus(@Path("id") Integer id, @Query("status") String status);

代码示例来源:origin: chaychan/TouTiao

@Headers({
    "Content-Type:application/x-www-form-urlencoded; charset=UTF-8",
    "Cookie:PHPSESSIID=334267171504; _ga=GA1.2.646236375.1499951727; _gid=GA1.2.951962968.1507171739; Hm_lvt_e0a6a4397bcb500e807c5228d70253c8=1507174305;Hm_lpvt_e0a6a4397bcb500e807c5228d70253c8=1507174305; _gat=1",
    "Origin:http://toutiao.iiilab.com"
})
@POST("https://www.parsevideo.com/api.php")
Observable<VideoPathResponse> parseVideo(@Query("url") String url,@Query("hash")String hash);

代码示例来源:origin: square/retrofit

String name = path.value();
validatePathName(p, name);
return new ParameterHandler.Path<>(method, p, name, converter, path.encoded());
String name = query.value();
boolean encoded = query.encoded();
validateResolvableType(p, type);
Header header = (Header) annotation;
String name = header.value();

代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources

@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.Resources listByResourceGroup" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources")
Observable<Response<ResponseBody>> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$expand") String expand, @Query("$top") Integer top, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

代码示例来源:origin: com.microsoft.azure/azure-mgmt-storage

@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.StorageAccounts listServiceSAS" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas")
Observable<Response<ResponseBody>> listServiceSAS(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body ServiceSasParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

代码示例来源:origin: smuyyh/BookReader

/**
 * 按分类获取书籍列表
 *
 * @param gender male、female
 * @param type   hot(热门)、new(新书)、reputation(好评)、over(完结)
 * @param major  玄幻
 * @param minor  东方玄幻、异界大陆、异界争霸、远古神话
 * @param limit  50
 * @return
 */
@GET("/book/by-categories")
Observable<BooksByCats> getBooksByCats(@Query("gender") String gender, @Query("type") String type, @Query("major") String major, @Query("minor") String minor, @Query("start") int start, @Query("limit") int limit);

代码示例来源:origin: Rukey7/MvpApp

/**
 * 获取美女图片,这个API不完整,省略了好多参数
 * eg: http://c.3g.163.com/recommend/getChanListNews?channel=T1456112189138&size=20&offset=0
 *
 * @param offset 起始页码
 * @return
 */
@Headers(CACHE_CONTROL_NETWORK)
@GET("recommend/getChanListNews?channel=T1456112189138&size=20")
Observable<Map<String, List<BeautyPhotoInfo>>> getBeautyPhoto(@Query("offset") int offset);

代码示例来源:origin: com.squareup.retrofit2/retrofit

String name = path.value();
validatePathName(p, name);
return new ParameterHandler.Path<>(name, converter, path.encoded());
String name = query.value();
boolean encoded = query.encoded();
validateResolvableType(p, type);
Header header = (Header) annotation;
String name = header.value();

代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources

@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.Providers list" })
@GET("subscriptions/{subscriptionId}/providers")
Observable<Response<ResponseBody>> list(@Path("subscriptionId") String subscriptionId, @Query("$top") Integer top, @Query("$expand") String expand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

代码示例来源:origin: com.microsoft.azure/azure-mgmt-storage

@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.StorageAccounts regenerateKey" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey")
Observable<Response<ResponseBody>> regenerateKey(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StorageAccountRegenerateKeyParameters regenerateKey, @Header("User-Agent") String userAgent);

代码示例来源:origin: smuyyh/BookReader

/**
 * 获取综合讨论区帖子详情内的评论列表
 *
 * @param disscussionId->_id
 * @param start              0
 * @param limit              30
 * @return
 */
@GET("/post/{disscussionId}/comment")
Observable<CommentList> getBookDisscussionComments(@Path("disscussionId") String disscussionId, @Query("start") String start, @Query("limit") String limit);

代码示例来源:origin: HotBitmapGG/bilibili-android-client

/**
 * 专题视频
 */
@GET("spview")
Observable<SpecialTopicIResult> getSpItemList(@Query("spid") int spid, @Query("season_id") int season_id, @Query("bangumi") int bangumi);

代码示例来源:origin: hidroh/materialistic

@Headers({RestServiceFactory.CACHE_CONTROL_MAX_AGE_24H,
      X_API_KEY + BuildConfig.MERCURY_TOKEN})
  @GET("parser")
  Observable<Readable> parse(@Query("url") String url);
}

代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources

@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.PolicyAssignments list" })
@GET("subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments")
Observable<Response<ResponseBody>> list(@Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

相关文章