Package com.restfb

Interface WebRequestor

All Known Implementing Classes:
DefaultWebRequestor, ETagWebRequestor

public interface WebRequestor
Specifies how a class that sends HTTP requests to the Facebook API endpoint must operate.
Author:
Mark Allen
  • Method Details

    • executeGet

      WebRequestor.Response executeGet​(String url, String headerAccessToken) throws IOException
      Given a Facebook API endpoint URL, execute a GET against it.
      Parameters:
      url - The URL to make a GET request for, including URL parameters.
      headerAccessToken - access token used in the header. May be null, if access token is already part of the query string
      Returns:
      HTTP response data.
      Throws:
      IOException - If an error occurs while performing the GET operation.
      Since:
      1.5
    • executeGet

      Given a Facebook API endpoint URL, execute a GET against it.
      Parameters:
      url - The URL to make a GET request for, including URL parameters.
      Returns:
      HTTP response data.
      Throws:
      IOException - If an error occurs while performing the GET operation.
      Since:
      1.5
    • executePost

      WebRequestor.Response executePost​(String url, String parameters, String headerAccessToken) throws IOException
      Given a Facebook API endpoint URL and parameter string, execute a POST to the endpoint URL.
      Parameters:
      url - The URL to POST to.
      parameters - The parameters to be POSTed.
      headerAccessToken - access token used in the header. May be null, if access token is already part of the query string
      Returns:
      HTTP response data.
      Throws:
      IOException - If an error occurs while performing the POST.
    • executePost

      WebRequestor.Response executePost​(String url, String parameters, List<BinaryAttachment> binaryAttachments, String headerAccessToken) throws IOException
      Given a Facebook API endpoint URL and parameter string, execute a POST to the endpoint URL.
      Parameters:
      url - The URL to POST to.
      parameters - The parameters to be POSTed.
      binaryAttachments - Optional binary attachments to be included in the POST body (e.g. photos and videos).
      headerAccessToken - access token used in the header. May be null, if access token is already part of the query string
      Returns:
      HTTP response data.
      Throws:
      IOException - If an error occurs while performing the POST.
    • executeDelete

      WebRequestor.Response executeDelete​(String url, String headerAccessToken) throws IOException
      Given a Facebook API endpoint URL and parameter string, execute a DELETE to the endpoint URL.
      Parameters:
      url - The URL to submit the DELETE to.
      headerAccessToken - access token used in the header. May be null, if access token is already part of the query string
      Returns:
      HTTP response data.
      Throws:
      IOException - If an error occurs while performing the DELETE.
    • getDebugHeaderInfo

      Provides access to the facebook header information. The fields x-fb-rev, x-fb-trace-id and x-fb-debug are checked and returned in a single container of the type DebugHeaderInfo
      Returns:
      container with the explained facebook debug header information