Package org.scribe.model

Examples of org.scribe.model.OAuthRequest.send()


        //This sample is mostly to help you debug and understand some of the scaffolding around the request-response cycle
        //https://developer.linkedin.com/documents/debugging-api-calls
        url = "https://api.linkedin.com/v1/people/~";
        request = new OAuthRequest(Verb.GET, url);
        service.signRequest(accessToken, request);
        response = request.send();
        //get all the headers
        System.out.println("Request headers: " + request.getHeaders().toString());
        System.out.println("Response headers: " + response.getHeaders().toString());
        //url requested
        System.out.println("Original location is: " + request.getHeaders().get("content-location"));
View Full Code Here


        // properly help debug issues. Please use the logged block from here when requesting
        // help in the forums.
        url = "https://api.linkedin.com/v1/people/FOOBARBAZ";
        request = new OAuthRequest(Verb.GET, url);
        service.signRequest(accessToken, request);
        response = request.send();

        responseNumber = response.getCode();

        if(responseNumber < 200 || responseNumber >= 300){
            logDiagnostics(request, response);
View Full Code Here

     * @see AccountInfo
     */
    public AccountInfo getAccountInfo() {
        OAuthRequest request = new OAuthRequest(Verb.GET, INFO_URL);
        service.signRequest(accessToken, request);
        String content = check(request.send()).getBody();

        return Json.parse(content, AccountInfo.class);
    }

    /**
 
View Full Code Here

        if (list != LIST) {
            request.addQuerystringParameter("list", Boolean.toString(list));
        }

        service.signRequest(accessToken, request);
        String content = checkMetadata(request.send()).getBody();

        return Json.parse(content, Entry.class);
    }

    /**
 
View Full Code Here

        request.addQuerystringParameter("root", "dropbox");
        request.addQuerystringParameter("from_path", encode(from));
        request.addQuerystringParameter("to_path", encode(to));

        service.signRequest(accessToken, request);
        String content = checkCopy(request.send()).getBody();

        return Json.parse(content, Entry.class);
    }

View Full Code Here

        request.addQuerystringParameter("root", "dropbox");
        request.addQuerystringParameter("from_path", encode(from));
        request.addQuerystringParameter("to_path", encode(to));

        service.signRequest(accessToken, request);
        String content = checkMove(request.send()).getBody();

        return Json.parse(content, Entry.class);
    }

    /**
 
View Full Code Here

        OAuthRequest request = new OAuthRequest(Verb.GET, FILE_OPS_DELETE_URL);
        request.addQuerystringParameter("root", "dropbox");
        request.addQuerystringParameter("path", encode(path));

        service.signRequest(accessToken, request);
        checkDelete(request.send());
    }

    /**
     * Create folder with specified path.
     *
 
View Full Code Here

        OAuthRequest request = new OAuthRequest(Verb.GET, FILE_OPS_CREATE_FOLDER_URL);
        request.addQuerystringParameter("root", "dropbox");
        request.addQuerystringParameter("path", encode(path));

        service.signRequest(accessToken, request);
        String content = checkCreateFolder(request.send()).getBody();

        return Json.parse(content, Entry.class);
    }

    /**
 
View Full Code Here

    public void putFile(File file, String path) throws IOException {
        OAuthRequest request = new OAuthRequest(Verb.POST, FILES_URL + encode(path));
        Multipart.attachFile(file, request);
        service.signRequest(accessToken, request);

        checkFiles(request.send());
    }

    /**
     * Download file with specified path.
     *
 
View Full Code Here

     */
    public EntryDownload getFile(String path) {
        OAuthRequest request = new OAuthRequest(Verb.GET, FILES_URL + encode(path));
        service.signRequest(accessToken, request);

        Response response = checkFiles(request.send());

        return new EntryDownload(response, path);
    }

    /**
 
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.