/** * This represents the status code of the HTTP response. * The response code represents the type of message that is * being sent to the client. For a description of the codes * see RFC 2616 section 10, Status Code Definitions. * * @return the status code that this HTTP response has */ public int getCode() { return response.getCode(); }
/** * This represents the status code of the HTTP response. * The response code represents the type of message that is * being sent to the client. For a description of the codes * see RFC 2616 section 10, Status Code Definitions. * * @return the status code that this HTTP response has */ public int getCode() { return response.getCode(); }
/** * This represents the status code of the HTTP response. * The response code represents the type of message that is * being sent to the client. For a description of the codes * see RFC 2616 section 10, Status Code Definitions. * * @return the status code that this HTTP response has */ public int getCode() { return response.getCode(); }
String accessTokenAlreadyHave = "..."; OAuth2AccessToken accessToken = new OAuth2AccessToken(accessTokenAlreadyHave); // Now let's go and ask for a protected resource! System.out.println("Now we're going to access a protected resource..."); final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service); service.signRequest(accessToken, request); final Response response = request.send(); System.out.println("Got it! Lets see what we found..."); System.out.println(); System.out.println(response.getCode()); System.out.println(response.getBody()); System.out.println();
Response response = httpClient.doLogin(username.getText().toString(), password.getText().toString()); if(response.getCode() == 200){
final OAuthService service = new ServiceBuilder() .provider(SimpleGeoApi.class) .apiKey("mykey") .apiSecret("mysecret") .signatureType(SignatureType.Header) .build(); new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { OAuthRequest request = new OAuthRequest(Verb.GET, "http://myweb.com/chapters.json"); service.signRequest(OAuthConstants.EMPTY_TOKEN, request); Response response = request.send(); Log.w("TEST", response.getCode() + " "); Log.w("TEST: ", response.getBody()); return null; } }.execute();