Java源码示例:retrofit2.http.Header

示例1
@Headers({"Domain-Name: " + Api.KE_DOU_WO_DOMAIN_NAME})
@GET
Observable<String> videoRelated(@Url String url, @Header("X-Forwarded-For") String ipAddress);
 
示例2
@FormUrlEncoded
@POST("api/provisional-accounts/create")
Observable<SignResponse> pixivSign(@Header("Authorization") String token,
                                   @Field("user_name") String userName,
                                   @Field("ref") String ref);
 
示例3
@FormUrlEncoded
@POST("/api/account/edit")
Observable<AccountEditResponse> changePixivID(@Header("Authorization") String token,
                                                      @Field("new_user_account") String new_user_account,
                                                      @Field("current_password") String current_password);
 
示例4
@FormUrlEncoded
@POST("/api/account/edit")
Observable<AccountEditResponse> changeEmailAndPixivID(@Header("Authorization") String token,
                                            @Field("new_mail_address") String new_mail_address,
                                            @Field("new_user_account") String new_user_account,
                                            @Field("current_password") String current_password);
 
示例5
@GET("v1/novel/ranking?filter=for_android")
Observable<ListNovel> getRankNovel(@Header("Authorization") String token,
                                   @Query("mode") String mode,
                                   @Query("date") String date);
 
示例6
@GET("v1/manga/recommended?include_privacy_policy=true&filter=for_android&include_ranking_illusts=true")
Observable<ListIllust> getRecmdManga(@Header("Authorization") String token);
 
示例7
@GET("v1/novel/recommended?include_privacy_policy=true&filter=for_android&include_ranking_novels=true")
Observable<ListNovel> getRecmdNovel(@Header("Authorization") String token);
 
示例8
@GET("v1/trending-tags/{type}?filter=for_android&include_translated_tag_results=true")
Observable<ListTrendingtag> getHotTags(@Header("Authorization") String token,
                                       @Path("type") String type);
 
示例9
@GET("v1/search/novel?filter=for_android&include_translated_tag_results=true")
Observable<ListNovel> searchNovel(@Header("Authorization") String token,
                                    @Query("word") String word,
                                    @Query("sort") String sort,
                                    @Query("search_target") String search_target);
 
示例10
@GET("v2/illust/related?filter=for_android")
Observable<ListIllust> relatedIllust(@Header("Authorization") String token,
                                     @Query("illust_id") int illust_id);
 
示例11
@GET("v1/user/bookmarks/illust")
Observable<ListIllust> getUserLikeIllust(@Header("Authorization") String token,
                                         @Query("user_id") int user_id,
                                         @Query("restrict") String restrict,
                                         @Query("tag") String tag);
 
示例12
@GET("v1/user/bookmarks/illust")
Observable<ListIllust> getUserLikeIllust(@Header("Authorization") String token,
                                         @Query("user_id") int user_id,
                                         @Query("restrict") String restrict);
 
示例13
@GET("v1/user/bookmarks/novel")
Observable<ListNovel> getUserLikeNovel(@Header("Authorization") String token,
                                       @Query("user_id") int user_id,
                                       @Query("restrict") String restrict);
 
示例14
@GET("v1/user/illusts?filter=for_android")
Observable<ListIllust> getUserSubmitIllust(@Header("Authorization") String token,
                                           @Query("user_id") int user_id,
                                           @Query("type") String type);
 
示例15
@GET("v1/user/novels")
Observable<ListNovel> getUserSubmitNovel(@Header("Authorization") String token,
                                         @Query("user_id") int user_id);
 
示例16
@GET("v2/illust/follow?restrict=all")
Observable<ListIllust> getFollowUserIllust(@Header("Authorization") String token);
 
示例17
@GET("v1/spotlight/articles?filter=for_android")
Observable<ListArticle> getArticles(@Header("Authorization") String token,
                                    @Query("category") String category);
 
示例18
@GET("v1/user/detail?filter=for_android")
Observable<UserDetailResponse> getUserDetail(@Header("Authorization") String token,
                                             @Query("user_id") int user_id);
 
示例19
@GET("v1/ugoira/metadata")
Observable<GifResponse> getGifPackage(@Header("Authorization") String token,
                                      @Query("illust_id") int illust_id);
 
示例20
@FormUrlEncoded
@POST("v1/user/follow/add")
Observable<NullResponse> postFollow(@Header("Authorization") String token,
                                    @Field("user_id") int user_id,
                                    @Field("restrict") String followType);
 
示例21
@FormUrlEncoded
@POST("v1/user/follow/delete")
Observable<NullResponse> postUnFollow(@Header("Authorization") String token,
                                      @Field("user_id") int user_id);
 
示例22
@GET("v1/user/follower?filter=for_android")
Observable<ListUser> getWhoFollowThisUser(@Header("Authorization") String token,
                                          @Query("user_id") int user_id);
 
示例23
@GET("v1/illust/comments")
Observable<ListComment> getComment(@Header("Authorization") String token,
                                   @Query("illust_id") int illust_id);
 
示例24
@GET
Observable<ListComment> getNextComment(@Header("Authorization") String token,
                                       @Url String nextUrl);
 
示例25
@FormUrlEncoded
@POST("v1/illust/comment/add")
Observable<CommentHolder> postComment(@Header("Authorization") String token,
                                      @Field("illust_id") int illust_id,
                                      @Field("comment") String comment);
 
示例26
@FormUrlEncoded
@POST("v1/illust/comment/add")
Observable<CommentHolder> postComment(@Header("Authorization") String token,
                                      @Field("illust_id") int illust_id,
                                      @Field("comment") String comment,
                                      @Field("parent_comment_id") int parent_comment_id);
 
示例27
@FormUrlEncoded
@POST("v2/illust/bookmark/add")
Observable<NullResponse> postLike(@Header("Authorization") String token,
                                  @Field("illust_id") int illust_id,
                                  @Field("restrict") String restrict);
 
示例28
@FormUrlEncoded
@POST("v2/novel/bookmark/add")
Observable<NullResponse> postLikeNovel(@Header("Authorization") String token,
                                       @Field("novel_id") int novel_id,
                                       @Field("restrict") String restrict);
 
示例29
@FormUrlEncoded
@POST("v2/illust/bookmark/add")
Observable<NullResponse> postLike(@Header("Authorization") String token,
                                  @Field("illust_id") int illust_id,
                                  @Field("restrict") String restrict,
                                  @Field("tags[]") String... tags);
 
示例30
@FormUrlEncoded
@POST("v1/illust/bookmark/delete")
Observable<NullResponse> postDislike(@Header("Authorization") String token,
                                     @Field("illust_id") int illust_id);