当前位置: 首页>>代码示例>>Java>>正文


Java Response类代码示例

本文整理汇总了Java中retrofit.client.Response的典型用法代码示例。如果您正苦于以下问题:Java Response类的具体用法?Java Response怎么用?Java Response使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Response类属于retrofit.client包,在下文中一共展示了Response类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAccessTokenFromAuthCode

import retrofit.client.Response; //导入依赖的package包/类
@FormUrlEncoded
@POST("/{tenantid}/oauth2/v2.0/token")
Response getAccessTokenFromAuthCode(
  @Path("tenantid") String tenantId,
  @Field("client_id") String clientId,
  @Field("client_secret") String clientSecret,
  @Field("grant_type") String grantType,
  @Field("code") String code,
  @Field("redirect_uri") String redirectUrl
);
 
开发者ID:OwaNotifier,项目名称:owa-notifier,代码行数:11,代码来源:TokenService.java

示例2: getMessages

import retrofit.client.Response; //导入依赖的package包/类
@GET("/v1.0/me/mailfolders/{folderid}/messages")
Response getMessages(
  @Path("folderid") String folderId,
  @Query("$orderby") String orderBy,
  @Query("$select") String select,
  @Query("$filter") String filter,
  @Query("$top") Integer maxResults
);
 
开发者ID:OwaNotifier,项目名称:owa-notifier,代码行数:9,代码来源:OutlookService.java

示例3: getPhotosAsync

import retrofit.client.Response; //导入依赖的package包/类
public void getPhotosAsync(final PhotoCallback callback) {
    if (mPhotos == null) {
        new RestAdapter.Builder()
                .setEndpoint(UnsplashService.ENDPOINT)
                .build()
                .create(UnsplashService.class).getFeed(new Callback<List<Photo>>() {
            @Override
            public void success(List<Photo> photos, Response response) {
                // the first items not interesting to us, get the last <n>
                mPhotos = new ArrayList<>(photos.subList(photos.size() - PHOTO_COUNT,
                        photos.size()));
                callback.success(mPhotos);
            }

            @Override
            public void failure(RetrofitError error) {
                callback.error();
                Log.e(TAG, "Could not load photos, " + error);
            }
        });
    } else {
        callback.success(mPhotos);
    }
}
 
开发者ID:googlesamples,项目名称:android-instant-apps,代码行数:25,代码来源:PhotoService.java

示例4: sendRequestOpenedPush

import retrofit.client.Response; //导入依赖的package包/类
private void sendRequestOpenedPush(OSNotificationOpenResult result) {
    RestAdapter retrofit = new RestAdapter.Builder()
            .setEndpoint("https://onesignal.com/api/v1/")
            .build();

    OneSignalApi service = retrofit.create(OneSignalApi.class);
    service.openedOneSignalPush(String.valueOf(result.notification.androidNotificationId), new OneSignalBody(), new Callback<OneSignalResponse>() {
        @Override
        public void success(OneSignalResponse oneSignalResponse, Response response) {
            Log.d("RETROFIT", "Is success:" + oneSignalResponse.isSuccess());
        }

        @Override
        public void failure(RetrofitError error) {
            Log.e("RETROFIT", error.toString());
        }
    });
}
 
开发者ID:Mun0n,项目名称:MADBike,代码行数:19,代码来源:MADBikeNotificationOpenedHandler.java

示例5: execute

import retrofit.client.Response; //导入依赖的package包/类
@Override
public void execute() throws Throwable {
    RestAdapter restAdapter = new RestAdapter.Builder().setEndpoint(context.getString(R.string.weather_url)).build();
    Apis apis = restAdapter.create(Apis.class);
    apis.getWeatherData(6359304, Locale.getDefault().getLanguage(), "metric", "43cd5e05d25e37bdffbad27e42619e3f", new Callback<WeatherResponse>() {
        @Override
        public void success(WeatherResponse weatherResponse, Response response) {
            EventBus.getDefault().post(weatherResponse);
        }

        @Override
        public void failure(RetrofitError error) {
            EventBus.getDefault().post(new WeatherResponse());
        }
    });

}
 
开发者ID:Mun0n,项目名称:MADBike,代码行数:18,代码来源:PostWeatherInteractor.java

示例6: getAccessTokenFromRefreshToken

import retrofit.client.Response; //导入依赖的package包/类
@FormUrlEncoded
@POST("/{tenantid}/oauth2/v2.0/token")
Response getAccessTokenFromRefreshToken(
  @Path("tenantid") String tenantId,
  @Field("client_id") String clientId,
  @Field("client_secret") String clientSecret,
  @Field("grant_type") String grantType,
  @Field("refresh_token") String code,
  @Field("redirect_uri") String redirectUrl
);
 
开发者ID:OwaNotifier,项目名称:owa-notifier,代码行数:11,代码来源:TokenService.java

示例7: getUserLoginInfo

import retrofit.client.Response; //导入依赖的package包/类
public void getUserLoginInfo(UserLoginQuery userLoginQuery, final UserListener listener) {
    mUserRestService.getUserLoginInfo(UserLoginQuery.Method, JSON, API_KEY, generateMD5(userLoginQuery.getSignature()), userLoginQuery.mUsername, userLoginQuery.mPassword, new Callback<UserLoginInfo>() {
        @Override
        public void success(UserLoginInfo userLoginInfo, Response response) {
            Log.d("Logedin", userLoginInfo.mSession.mToken + " " + userLoginInfo.mSession.mUsername);
            Bundle extras = new Bundle();
            extras.putString("lf_token", userLoginInfo.mSession.mToken);
            extras.putString("lf_user", userLoginInfo.mSession.mUsername);
            PreferencesUtility.getInstance(context).updateService(extras);
            mUserSession = userLoginInfo.mSession;
            mUserSession.update(context);
            listener.userSuccess();
        }

        @Override
        public void failure(RetrofitError error) {
            listener.userInfoFailed();
        }
    });
}
 
开发者ID:Vinetos,项目名称:Hello-Music-droid,代码行数:21,代码来源:LastFmClient.java

示例8: getUserReviews

import retrofit.client.Response; //导入依赖的package包/类
private void getUserReviews() {

        RetroInterface.getZomatoRestApi().getUserPhotos(
                user_id,
                new Callback<RestaurantImageResponse>() {
                    @Override
                    public void success(RestaurantImageResponse restaurantImageResponse, Response response) {

                        if(restaurantImageResponse!=null)
                        {
                            restaurantImages = restaurantImageResponse.getItems();
                            profileRestaurantImageAdapter.refresh(restaurantImages);
                        }

                    }

                    @Override
                    public void failure(RetrofitError error) {

                    }
                }
        );


    }
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:26,代码来源:ProfilePhotoFragment.java

示例9: getUserReviews

import retrofit.client.Response; //导入依赖的package包/类
private void getUserReviews() {

        RetroInterface.getZomatoRestApi().getUserDineline(
                user_id,
                new Callback<DinelineResponse>() {
                    @Override
                    public void success(DinelineResponse dinelineResponse, Response response) {

                        if (dinelineResponse != null) {
                            dinelineItems = dinelineResponse.getItems();
                            profileDinelineAdapter.refresh(dinelineItems);
                        }

                    }

                    @Override
                    public void failure(RetrofitError error) {

                    }
                }
        );


    }
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:25,代码来源:ProfileDinelineFragment.java

示例10: getUserReviews

import retrofit.client.Response; //导入依赖的package包/类
private void getUserReviews() {

        RetroInterface.getZomatoRestApi().getUserReviews(
                user_id,
                new Callback<ProfileReviewResponse>() {
                    @Override
                    public void success(ProfileReviewResponse restaurantDetailResponse, Response response) {

                        if(restaurantDetailResponse!=null)
                        {
                            reviewItems = restaurantDetailResponse.getItems();
                            reviewAdapter.refresh(reviewItems);
                        }

                    }

                    @Override
                    public void failure(RetrofitError error) {

                    }
                }
        );


    }
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:26,代码来源:ProfileReviewFragment.java

示例11: getAllCollections

import retrofit.client.Response; //导入依赖的package包/类
private void getAllCollections() {

        RetroInterface.getZomatoRestApi().getSavedCollection(
                SessionPreference.getUserId(context) + "",
                new Callback<CollectionResponse>() {
                    @Override
                    public void success(CollectionResponse collectionResponse, Response response) {

                        if (collectionResponse != null && collectionResponse.isSuccess()) {
                            items = collectionResponse.getItems();
                            recyclerViewAdapter.refresh(items);
                        }
                    }

                    @Override
                    public void failure(RetrofitError error) {

                    }
                }
        );

    }
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:23,代码来源:SavedCollectionFragment.java

示例12: getAllCollections

import retrofit.client.Response; //导入依赖的package包/类
private void getAllCollections() {

        RetroInterface.getZomatoRestApi().getRecommendedCollection(
                SessionPreference.getUserId(context) + "",
                new Callback<CollectionResponse>() {
                    @Override
                    public void success(CollectionResponse collectionResponse, Response response) {

                        if(collectionResponse!=null && collectionResponse.isSuccess()){
                            items = collectionResponse.getItems();
                            recyclerViewAdapter.refresh(items);
                        }

                    }

                    @Override
                    public void failure(RetrofitError error) {

                    }
                }
        );

    }
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:24,代码来源:SuggestedCollectionFragment.java

示例13: getAllCollections

import retrofit.client.Response; //导入依赖的package包/类
private void getAllCollections() {

        RetroInterface.getZomatoRestApi().getMyCollection(
                SessionPreference.getUserId(context) + "",
                new Callback<CollectionResponse>() {
                    @Override
                    public void success(CollectionResponse collectionResponse, Response response) {

                        if(collectionResponse!=null && collectionResponse.isSuccess()){
                            items = collectionResponse.getItems();
                            recyclerViewAdapter.refresh(items);
                        }
                    }

                    @Override
                    public void failure(RetrofitError error) {

                    }
                }
        );

    }
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:23,代码来源:MyCollectionFragment.java

示例14: getAllCollections

import retrofit.client.Response; //导入依赖的package包/类
private void getAllCollections() {

        RetroInterface.getZomatoRestApi().getFollowCollection(
                SessionPreference.getUserId(context) + "",
                new Callback<CollectionResponse>() {
                    @Override
                    public void success(CollectionResponse collectionResponse, Response response) {

                        if(collectionResponse!=null && collectionResponse.isSuccess()){
                            items = collectionResponse.getItems();
                            recyclerViewAdapter.refresh(items);
                        }
                    }

                    @Override
                    public void failure(RetrofitError error) {

                    }
                }
        );

    }
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:23,代码来源:FollowingCollectionFragment.java

示例15: updateLocation

import retrofit.client.Response; //导入依赖的package包/类
private void updateLocation(final UserLocation location) {

        RetroInterface.getZomatoRestApi().setUserLocation(
                SessionPreference.getUserId(context) + "",
                location.getId() + "",
                new Callback<NormalResponse>() {
                    @Override
                    public void success(NormalResponse normalResponse, Response response) {
                        LocationPreference.setLocationParams(context, location);
                        finish();
                    }

                    @Override
                    public void failure(RetrofitError error) {

                    }
                }
        );
    }
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:20,代码来源:SelectLocationActivity.java


注:本文中的retrofit.client.Response类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。