protected <T extends InstagramObject> T createInstagramObject(Verbs verbs, Class<T> clazz, String methodName,
            String rawMethodName, Map<String, String> params) throws InstagramException {
    """
	Create a instagram object based on class-name and response.
	
	This method must be used when signing requests if the methodName
	could contain characters that required URI encoding
	
	@param verbs
	HTTP State
	@param clazz
	@param methodName
	@param rawMethodName
	@param params
	@return
	@throws InstagramException
    """
        Response response;
        String jsonResponseBody;
        try {
            response = getApiResponse(verbs, methodName, rawMethodName, params);

	        if (config.isRetryOnServerError() && wasResponseAnError(response)) {
		        Exception responseException = testResponseBody(response);

		        int numberOfRetries = 2;
		        int retryAttemptNumber = 0;
		        while (responseException != null && retryAttemptNumber < numberOfRetries) {
			        try { Thread.sleep(1000); } catch (InterruptedException e) { /* ignore */ }
			        // Retry request
			        logger.warn("(Retry #{}) Retrying request for {}", retryAttemptNumber, response.getURL());
			        response = getApiResponse(verbs, methodName, rawMethodName, params);
			        responseException = testResponseBody(response);
			        retryAttemptNumber++;
		        }
	        }

			jsonResponseBody = response.getBody();
            LogHelper.prettyPrintJSONResponse(logger, jsonResponseBody);
        } catch (IOException e) {
            throw new InstagramException("IOException while retrieving data", e);
        }

        Map<String, String> responseHeaders = response.getHeaders();
        if (response.getCode() >= 200 && response.getCode() < 300) {
	        T object = createObjectFromResponse(clazz, jsonResponseBody);
            object.setHeaders(responseHeaders);
            return object;
        }

        throw handleInstagramError(response.getCode(), jsonResponseBody, responseHeaders);
    }
protected <T extends InstagramObject> T createInstagramObject(Verbs verbs, Class<T> clazz, String methodName,
            String rawMethodName, Map<String, String> params) throws InstagramException {
        Response response;
        String jsonResponseBody;
        try {
            response = getApiResponse(verbs, methodName, rawMethodName, params);

	        if (config.isRetryOnServerError() && wasResponseAnError(response)) {
		        Exception responseException = testResponseBody(response);

		        int numberOfRetries = 2;
		        int retryAttemptNumber = 0;
		        while (responseException != null && retryAttemptNumber < numberOfRetries) {
			        try { Thread.sleep(1000); } catch (InterruptedException e) { /* ignore */ }
			        // Retry request
			        logger.warn("(Retry #{}) Retrying request for {}", retryAttemptNumber, response.getURL());
			        response = getApiResponse(verbs, methodName, rawMethodName, params);
			        responseException = testResponseBody(response);
			        retryAttemptNumber++;
		        }
	        }

			jsonResponseBody = response.getBody();
            LogHelper.prettyPrintJSONResponse(logger, jsonResponseBody);
        } catch (IOException e) {
            throw new InstagramException("IOException while retrieving data", e);
        }

        Map<String, String> responseHeaders = response.getHeaders();
        if (response.getCode() >= 200 && response.getCode() < 300) {
	        T object = createObjectFromResponse(clazz, jsonResponseBody);
            object.setHeaders(responseHeaders);
            return object;
        }

        throw handleInstagramError(response.getCode(), jsonResponseBody, responseHeaders);
    }
protected < T extends InstagramObject > T createInstagramObject ( Verbs verbs , Class < T > clazz , String methodName , String rawMethodName , Map < String , String > params ) throws InstagramException { Response response ; String jsonResponseBody ; try { response = getApiResponse ( verbs , methodName , rawMethodName , params ) ; if ( config . isRetryOnServerError ( ) && wasResponseAnError ( response ) ) { Exception responseException = testResponseBody ( response ) ; int numberOfRetries = 2 ; int retryAttemptNumber = 0 ; while ( responseException != null && retryAttemptNumber < numberOfRetries ) { try { Thread . sleep ( 1000 ) ; } catch ( InterruptedException e ) { /* ignore */ } // Retry request logger . warn ( "(Retry #{}) Retrying request for {}" , retryAttemptNumber , response . getURL ( ) ) ; response = getApiResponse ( verbs , methodName , rawMethodName , params ) ; responseException = testResponseBody ( response ) ; retryAttemptNumber ++ ; } } jsonResponseBody = response . getBody ( ) ; LogHelper . prettyPrintJSONResponse ( logger , jsonResponseBody ) ; } catch ( IOException e ) { throw new InstagramException ( "IOException while retrieving data" , e ) ; } Map < String , String > responseHeaders = response . getHeaders ( ) ; if ( response . getCode ( ) >= 200 && response . getCode ( ) < 300 ) { T object = createObjectFromResponse ( clazz , jsonResponseBody ) ; object . setHeaders ( responseHeaders ) ; return object ; } throw handleInstagramError ( response . getCode ( ) , jsonResponseBody , responseHeaders ) ; }
Create a instagram object based on class-name and response.

This method must be used when signing requests if the methodName
could contain characters that required URI encoding

@param verbs
HTTP State
@param clazz
@param methodName
@param rawMethodName
@param params
@return
@throws InstagramException
Create a instagram object based on class - name and response .