public HttpRequest form(final Object name,final Object value,String charset) throws HttpRequestException {
  final boolean first=!form;
  if (first) {
    contentType(CONTENT_TYPE_FORM,charset);
    form=true;
  }
  charset=getValidCharset(charset);
  try {
    openOutput();
    if (!first)     output.write('&');
    output.write(URLEncoder.encode(name.toString(),charset));
    output.write('=');
    if (value != null)     output.write(URLEncoder.encode(value.toString(),charset));
  }
 catch (  IOException e) {
    throw new HttpRequestException(e);
  }
  return this;
}

public HttpRequest form ( final Object name , final Object value , String charset ) throws HttpRequestException { final boolean first = ! form ; if ( first ) { contentType ( CONTENT_TYPE_FORM , charset ) ; form = true ; } charset = getValidCharset ( charset ) ; try { openOutput ( ) ; if ( ! first ) output . write ( '&' ) ; output . write ( URLEncoder . encode ( name . toString ( ) , charset ) ) ; output . write ( '=' ) ; if ( value != null ) output . write ( URLEncoder . encode ( value . toString ( ) , charset ) ) ; } catch ( IOException e ) { throw new HttpRequestException ( e ) ; } return this ; }
write the name / value pair as form data to the request body < p > the values specified will be url - encoded and sent with the ' application / x - www - form - urlencoded ' content - type
