Package org.jinstagram.auth.model

Examples of org.jinstagram.auth.model.OAuthRequest.addQuerystringParameter()


   
    // Additional parameters in url
    if (params != null) {
      for (Map.Entry<String, String> entry : params.entrySet()) {
        if (verb == Verbs.GET) {
          request.addQuerystringParameter(entry.getKey(), entry.getValue());
        }
        else {
          request.addBodyParameter(entry.getKey(), entry.getValue());
        }
      }
View Full Code Here


    }

    // Add the AccessToken to the Request Url
    if ((verb == Verbs.GET) || (verb == Verbs.DELETE)) {
      if (accessToken == null) {
          request.addQuerystringParameter(OAuthConstants.CLIENT_ID, clientId);
      } else {
          request.addQuerystringParameter(OAuthConstants.ACCESS_TOKEN, accessToken.getToken());
      }
    }
    else {
View Full Code Here

    // Add the AccessToken to the Request Url
    if ((verb == Verbs.GET) || (verb == Verbs.DELETE)) {
      if (accessToken == null) {
          request.addQuerystringParameter(OAuthConstants.CLIENT_ID, clientId);
      } else {
          request.addQuerystringParameter(OAuthConstants.ACCESS_TOKEN, accessToken.getToken());
      }
    }
    else {
        if (accessToken == null) {
            request.addBodyParameter(OAuthConstants.CLIENT_ID, clientId);
View Full Code Here

     *
     * @param id the id of the subscription to remove
     */
    public SubscriptionResponse deleteSubscription(String id) throws InstagramException {
        final OAuthRequest request = prepareOAuthRequest(Verbs.DELETE);
        request.addQuerystringParameter("id", id);

        try {
            final Response response = request.send();
            return getSubscriptionResponse(response.getBody());
        } catch (IOException e) {
View Full Code Here

     *
     * @return the response of this request, holding mainly the code
     */
  public SubscriptionResponse deleteAllSubscription() throws InstagramException {
        final OAuthRequest request = prepareOAuthRequest(Verbs.DELETE);
    request.addQuerystringParameter(Constants.SUBSCRIPTION_TYPE, "all");

        try {
            final Response response = request.send();
            return getSubscriptionResponse(response.getBody());
        } catch (IOException e) {
View Full Code Here

        String clientSecret = params.get(Constants.CLIENT_SECRET);
        Preconditions.checkEmptyString(clientSecret, "You must provide a clientSecret");

        final OAuthRequest request = new OAuthRequest(verb, Constants.SUBSCRIPTION_ENDPOINT);
        // Add the oauth parameter in the body
        request.addQuerystringParameter(Constants.CLIENT_ID, clientId);
        request.addQuerystringParameter(Constants.CLIENT_SECRET, clientSecret);

        return request;
    }
View Full Code Here

        Preconditions.checkEmptyString(clientSecret, "You must provide a clientSecret");

        final OAuthRequest request = new OAuthRequest(verb, Constants.SUBSCRIPTION_ENDPOINT);
        // Add the oauth parameter in the body
        request.addQuerystringParameter(Constants.CLIENT_ID, clientId);
        request.addQuerystringParameter(Constants.CLIENT_SECRET, clientSecret);

        return request;
    }

    private SubscriptionResponse getSubscriptionResponse(String jsonBody) throws InstagramException {
View Full Code Here

        // Additional parameters in url
        if (params != null) {
            for (Map.Entry<String, String> entry : params.entrySet()) {
                if (verb == Verbs.GET) {
                    request.addQuerystringParameter(entry.getKey(), entry.getValue());
                }
                else {
                    request.addBodyParameter(entry.getKey(), entry.getValue());
                }
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.