Class BatchRequest.BatchRequestBuilder

    • Constructor Detail

      • BatchRequestBuilder

        public BatchRequestBuilder​(String relativeUrl)
        Creates a batch request builder using the provided FB endpoint.

        You can explicitly specify URL parameters here, or use parameters(Parameter...) instead if you prefer to have the query string constructed programmatically.

        Parameters:
        relativeUrl - The endpoint to hit, for example "me/friends".
    • Method Detail

      • method

        public BatchRequest.BatchRequestBuilder method​(String method)
        Sets the HTTP method for the request generated by this builder, for example "POST" (GET is the default value for this builder).
        Parameters:
        method - The HTTP method.
        Returns:
        This builder.
      • name

        public BatchRequest.BatchRequestBuilder name​(String name)
        Sets the logical name for the request generated by this builder. Useful for specifying dependencies between operations - the generated request can be referenced by name.
        Parameters:
        name - The logical name of the request generated by this builder.
        Returns:
        This builder.
      • body

        public BatchRequest.BatchRequestBuilder body​(Parameter... parameters)
        Sets the request body parameters for the request generated by this builder, for example Parameter.with("message", "Test status update").
        Parameters:
        parameters - The request body parameters.
        Returns:
        This builder.
      • attachedFiles

        public BatchRequest.BatchRequestBuilder attachedFiles​(String attachedFiles)
        Sets the comma-delimited names of any attached files for this builder, for example "cat1, cat2".
        Parameters:
        attachedFiles - The names of any attached files for this builder.
        Returns:
        This builder.
      • dependsOn

        public BatchRequest.BatchRequestBuilder dependsOn​(String dependsOn)
        Specifies if the request generated by this builder depends on the completion of another call in the current batch, for example "first".
        Parameters:
        dependsOn - A reference to another request in the batch that this builder's request depends on.
        Returns:
        This builder.
      • omitResponseOnSuccess

        public BatchRequest.BatchRequestBuilder omitResponseOnSuccess​(boolean omitResponseOnSuccess)
        To make sure FB returns JSON in the event that this builder's request completes successfully, set this to false.
        Parameters:
        omitResponseOnSuccess - Set this to false to make sure FB returns JSON in the event that this builder's request completes successfully,
        Returns:
        This builder.