Annotation Type FieldMap



  • @Documented
     @Target(value=PARAMETER)
     @Retention(value=RUNTIME)
    public @interface FieldMap
    Named key/value pairs for a form-encoded request.

    Field values may be null which will omit them from the request body.

    Simple Example:

     @FormUrlEncoded
     @POST("/things")
     void things(@FieldMap Map<String, String> fields);
     }
     
    Calling with foo.things(ImmutableMap.of("foo", "bar", "kit", "kat") yields a request body of foo=bar&kit=kat.
    See Also:
    FormUrlEncoded, Field
    • Optional Element Summary

      Optional Elements

      Modifier and Type Optional Element and Description
      boolean encodeNames
      Specifies whether parameter names (keys in the map) are URL encoded.
      boolean encodeValues
      Specifies whether parameter values (values in the map) are URL encoded.
    • Element Detail

      • encodeNames

        public abstract boolean encodeNames
        Specifies whether parameter names (keys in the map) are URL encoded.
        Default:
        true
      • encodeValues

        public abstract boolean encodeValues
        Specifies whether parameter values (values in the map) are URL encoded.
        Default:
        true