Class RestOperation

java.lang.Object
org.apache.juneau.rest.client.RestOperation

public class RestOperation extends Object
Aggregates the HTTP method, URL, and optional body into a single bean.
See Also:
  • Field Details

    • NO_BODY

      public static final Object NO_BODY
      A placeholder for a non-existent body. Used to identify when form-data should be used in a request body. Note that this is different than a null body since a null can be a serialized request.
  • Constructor Details

    • RestOperation

      public RestOperation(String method, Object url, Object body)
      Constructor.
      Parameters:
      method - The HTTP method.
      url - The URI of the remote REST resource.
      Can be any of the following types:
      body - The HTTP body.
  • Method Details

    • of

      public static RestOperation of(String method, Object url)
      Creator.
      Parameters:
      method - The HTTP method.
      url - The URI of the remote REST resource.
      Can be any of the following types:
      Returns:
      A new RestOperation object.
    • of

      public static RestOperation of(String method, Object url, Object body)
      Creator.
      Parameters:
      method - The HTTP method.
      url - The URI of the remote REST resource.
      Can be any of the following types:
      body - The HTTP body.
      Returns:
      A new RestOperation object.
    • getUri

      public Object getUri()
      Bean property getter: url.
      Returns:
      The value of the url property on this bean, or null if it is not set.
    • getMethod

      public String getMethod()
      Bean property getter: method.
      Returns:
      The value of the method property on this bean, or null if it is not set.
    • getContent

      public Object getContent()
      Bean property getter: content.
      Returns:
      The value of the content property on this bean.
      Returns NO_BODY if the request does not have a body set.
      A null value means null should be the serialized response.
    • hasContent

      public boolean hasContent()
      Identifies whether this HTTP method typically has content.
      Returns:
      true if this HTTP method typically has content.
    • hasContent

      public RestOperation hasContent(boolean value)
      Overrides the default value for the hasContent() method.
      Parameters:
      value - The new value.
      Returns:
      This object.