Annotation Type FormParam


  • @Retention(RUNTIME)
    @Target(PARAMETER)
    public @interface FormParam
    Annotation for form parameters to be sent to a REST API Request URI.

    Example 1:

     @POST("spellcheck")
     Observable<Response<ResponseBody>> spellChecker(@Header("X-BingApis-SDK") String xBingApisSDK, @Query
     ("UserId") String userId, @FormParam("Text") String text);

    The value of parameter text will be encoded and encoded value will be added to the form data sent to the API.

    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String value  
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean encoded
      A value true for this argument indicates that value of value() is already encoded hence engine should not encode it, by default value will be encoded.
    • Element Detail

      • value

        String value
        Returns:
        The name of the key in a key value pair as part of the form data
      • encoded

        boolean encoded
        A value true for this argument indicates that value of value() is already encoded hence engine should not encode it, by default value will be encoded.
        Returns:
        Whether or not this query parameter is already encoded.
        Default:
        false