Interface Request

  • All Implemented Interfaces:

    
    public interface Request
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • getUrl

         abstract String getUrl()

        The URL to perform this request on.

      • getData

         abstract Object getData()

        The data for the body of this request.

      • getJson

         abstract Object getJson()

        An object to use as the JSON payload for this request. Some special things happen if this isn't null.

        If this is not null,

        • whatever is specified in data will be overwritten

        • the Content-Type header becomes application/json

        • the object specified is coerced into either a JSONArray or a JSONObject

        • JSONObjects and JSONArrays are treated as such and will not undergo coercion

        • Maps become JSONObjects by using the appropriate constructor. Keys are converted to Strings, with null becoming "null"

        • Collections becomes JSONArrays by using the appropriate constructor.

        • Arrays become JSONArrays by using the appropriate constructor.

        • any other Iterables becomes JSONArrays using a custom method.

        • any other object throws an IllegalArgumentException

      • getCookies

         abstract Map<String, String> getCookies()

        A Map of cookies to send with this request. Note that CookieJar is a map. It also has a constructor that takes a map, for easy conversion.

      • getTimeout

         abstract Double getTimeout()

        The amount of time to wait, in seconds, for the server to send data.

      • getStream

         abstract Boolean getStream()

        If the response content should be immediately downloaded (false) or streamed (true).