Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Commit

Permalink
Merge pull request #10 from habuma/master
Browse files Browse the repository at this point in the history
Expose RestOperations through Facebook interface
  • Loading branch information
habuma committed Dec 9, 2011
2 parents 918c7c8 + 569b045 commit 962427f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import org.springframework.social.ApiBinding;
import org.springframework.social.facebook.api.impl.FacebookTemplate;
import org.springframework.web.client.RestOperations;


/**
Expand Down Expand Up @@ -76,4 +77,10 @@ public interface Facebook extends GraphApi, ApiBinding {
*/
UserOperations userOperations();

/**
* Returns the underlying {@link RestOperations} object allowing for consumption of Facebook endpoints that may not be otherwise covered by the API binding.
* The RestOperations object returned is configured to include an OAuth 2 "Authorization" header on all requests.
*/
RestOperations restOperations();

}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.springframework.social.support.URIBuilder;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestOperations;
import org.springframework.web.client.RestTemplate;

/**
Expand Down Expand Up @@ -154,6 +155,10 @@ public PageOperations pageOperations() {
return pageOperations;
}

public RestOperations restOperations() {
return getRestTemplate();
}

// low-level Graph API operations
public <T> T fetchObject(String objectId, Class<T> type) {
URI uri = URIBuilder.fromUri(GRAPH_API_URL + objectId).build();
Expand Down

0 comments on commit 962427f

Please sign in to comment.