本文整理汇总了Java中retrofit.http.Headers类的典型用法代码示例。如果您正苦于以下问题:Java Headers类的具体用法?Java Headers怎么用?Java Headers使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Headers类属于retrofit.http包,在下文中一共展示了Headers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getGoogleApiToken
import retrofit.http.Headers; //导入依赖的package包/类
@Headers({
Constants.USER_AGENT_HEADER + ": " + Constants.USER_AGENT_HEADER_VALUE
})
@FormUrlEncoded
@POST(Constants.GOOGLE_TOKEN_URL)
Call<GoogleToken> getGoogleApiToken(@Field("code") String code, @Field("client_id") String clientId,
@Field("client_secret") String clientSecret, @Field("redirect_uri") String redirectUri,
@Field("refresh_token") String refreshToken, @Field("grant_type") String grantType);
示例2: getAlbumInfo
import retrofit.http.Headers; //导入依赖的package包/类
@Headers("Cache-Control: public")
@GET(BASE_PARAMETERS_ALBUM)
void getAlbumInfo(@Query("artist") String artist, @Query("album") String album, Callback<AlbumInfo> callback);
示例3: getArtistInfo
import retrofit.http.Headers; //导入依赖的package包/类
@Headers("Cache-Control: public")
@GET(BASE_PARAMETERS_ARTIST)
void getArtistInfo(@Query("artist") String artist, Callback<ArtistInfo> callback);
示例4: uploadImage
import retrofit.http.Headers; //导入依赖的package包/类
@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);
示例5: getAlbumData
import retrofit.http.Headers; //导入依赖的package包/类
@Headers({
"Host: a.4493.com",
"User-Agent: 21",
"Content-Type: text/plain; charset=UTF-8"
})
@Multipart
@POST("rest/")
Observable<AlbumData> getAlbumData(
@Part(value = "appkey",encoding="8bit") String appkey, @Part(value = "channel_id",encoding="8bit") String channelid,
@Part(value = "crc",encoding="8bit") String crc
, @Part(value = "page",encoding="8bit") int page, @Part(value = "pagesize",encoding="8bit") int pagesize
, @Part(value = "ver",encoding="8bit") String ver, @Part(value = "api",encoding="8bit") String api,
@Part(value = "market",encoding="8bit") String market, @Part(value = "version",encoding="8bit") String version,@Part(value = "keyword",encoding="8bit") String key);
示例6: getToken
import retrofit.http.Headers; //导入依赖的package包/类
@Headers({ACCEPT_JSON_HEADER})
@FormUrlEncoded
@POST("/oauth/access_token")
BitlyOAuthToken getToken(@Header("Authorization") String authorizationHeader,
@Field("grant_type") String grantType,
@Field("username") String username,
@Field("password") String password);
示例7: getPollutionData
import retrofit.http.Headers; //导入依赖的package包/类
@Headers({
"X-User-Email: [email protected]",
"X-User-Token: 4AeUTqRoixc9wMM_wCkM"
})
@GET("/air_qualities.json/?current_values=1&discard_average=1")
void getPollutionData(Callback<PollutionResponse> callback);
示例8: openedOneSignalPush
import retrofit.http.Headers; //导入依赖的package包/类
@Headers("Content-Type: application/json")
@PUT("/notifications/{id}/") void openedOneSignalPush(@Path("id") String id, @Body OneSignalBody data, Callback<OneSignalResponse> response);
示例9: doesContactExist
import retrofit.http.Headers; //导入依赖的package包/类
@POST("Publisher/DoesContactExistByName")
@Headers({"Content-Length: 0"})
Call<ResponseBody> doesContactExist(@Query("sessionId") String sessionId,
@Query("contactName") String contactName);
示例10: createContact
import retrofit.http.Headers; //导入依赖的package包/类
@POST("Publisher/CreateContact")
@Headers({"Content-Length: 0"})
Call<String> createContact(@Query("sessionId") String sessionId,
@Query("contactName") String contactName,
@Query("emailAddress") String emailAddress);
示例11: deleteContact
import retrofit.http.Headers; //导入依赖的package包/类
@POST("Publisher/DeleteContact")
@Headers({"Content-Length: 0"})
Call<ResponseBody> deleteContact(@Query("sessionId") String sessionId,
@Query("contactId") String contactId);
示例12: getAuthToken
import retrofit.http.Headers; //导入依赖的package包/类
@Headers("Content-Type: application/json")
@POST("/api-token-auth/")
Token getAuthToken(@Body AuthUser authUser);
示例13: loginUser
import retrofit.http.Headers; //导入依赖的package包/类
@FormUrlEncoded
@Headers({"Content-Type: application/x-www-form-urlencoded",
"Accept: application/json",
"Accept-Encoding: gzip, deflate"})
@POST("/api/register")
LoginAnswer loginUser(@Field("email") String email);
示例14: getHomeStream
import retrofit.http.Headers; //导入依赖的package包/类
@Headers("Accept: application/json")
@GET("/")
Observable<MuResponse> getHomeStream(@Query("page") int page, @Query("sort") String sort);
示例15: getCategoryStream
import retrofit.http.Headers; //导入依赖的package包/类
@Headers("Accept: application/json")
@GET("/posts/c/{cat}/{sub}")
Observable<MuResponse> getCategoryStream(@Path("cat") String cat, @Path("sub") String sub, @Query("page") int page, @Query("sort") String sort);