src/main/java/org/jinstagram/realtime/InstagramSubscription.java
public SubscriptionResponse createSubscription() throws InstagramException {
		String callback = params.get(Constants.CALLBACK_URL);
		if(callback == null){
			callback = "";
		}
		Preconditions.checkEmptyString(callback, "You must provide a callback url");

        final OAuthRequest request = prepareOAuthRequest(Verbs.POST);
		request.addBodyParameter(Constants.ASPECT, "media");
		
		for(Map.Entry<String, String> entry: this.params.entrySet()){
			request.addBodyParameter(entry.getKey(), entry.getValue());
		}

        try {
            final Response response = request.send();
            return getSubscriptionResponse(response.getBody());
        } catch (IOException e) {
            throw new InstagramException("Failed to create subscription", e);
        }
	}
public SubscriptionResponse createSubscription() throws InstagramException {
		String callback = params.get(Constants.CALLBACK_URL);
		if(callback == null){
			callback = "";
		}
		Preconditions.checkEmptyString(callback, "You must provide a callback url");

        final OAuthRequest request = prepareOAuthRequest(Verbs.POST);
		request.addBodyParameter(Constants.ASPECT, "media");
		
		for(Map.Entry<String, String> entry: this.params.entrySet()){
			request.addBodyParameter(entry.getKey(), entry.getValue());
		}

        try {
            final Response response = request.send();
            return getSubscriptionResponse(response.getBody());
        } catch (IOException e) {
            throw new InstagramException("Failed to create subscription", e);
        }
	}
public SubscriptionResponse createSubscription ( ) throws InstagramException { String callback = params . get ( Constants . CALLBACK_URL ) ; if ( callback == null ) { callback = "" ; } Preconditions . checkEmptyString ( callback , "You must provide a callback url" ) ; final OAuthRequest request = prepareOAuthRequest ( Verbs . POST ) ; request . addBodyParameter ( Constants . ASPECT , "media" ) ; for ( Map . Entry < String , String > entry : this . params . entrySet ( ) ) { request . addBodyParameter ( entry . getKey ( ) , entry . getValue ( ) ) ; } try { final Response response = request . send ( ) ; return getSubscriptionResponse ( response . getBody ( ) ) ; } catch ( IOException e ) { throw new InstagramException ( "Failed to create subscription" , e ) ; } }
Creates a subscription with the current state of this instance.
<p/>
The {@link SubscriptionResponse} holds the result of the subscription such as the identifier
of the subscription that can be used later to {@linkplain #deleteSubscription(String) delete it}.

@return the result of the subscription
@throws InstagramException
Creates a subscription with the current state of this instance . <p / > The { @link SubscriptionResponse } holds the result of the subscription such as the identifier of the subscription that can be used later to { @linkplain #deleteSubscription ( String ) delete it } .