common/src/main/java/HTTPClient/HTTPConnection.java
/**
     * POST's form-data to the specified file using the specified headers.
     * The data is first urlencoded and then turned into a string of the
     * form "name1=value1&name2=value2". If no <var>Content-type</var> header
     * is given then one is added with a value of
     * <var>application/x-www-form-urlencoded</var>.
     *
     * @param     file      the absolute path of the file
     * @param     form_data an array of Name/Value pairs
     * @param     headers   additional headers
     * @return    a HTTPResponse structure containing the response
     * @exception java.io.IOException when an exception is returned from
     *                                the socket.
     * @exception ModuleException if an exception is encountered in any module.
     */
POST's form-data to the specified file using the specified headers.
The data is first urlencoded and then turned into a string of the
form "name1=value1&name2=value2". If no Content-type header
is given then one is added with a value of
application/x-www-form-urlencoded.


POST ' s form - data to the specified file using the specified headers . The data is first urlencoded and then turned into a string of the form " name1 = value1&name2 = value2 " . If no Content - type header is given then one is added with a value of application / x - www - form - urlencoded .
public HTTPResponse Post(String file, NVPair form_data[], NVPair headers[])
                throws IOException, ModuleException
    {
	int idx;
	for (idx=0; idx<headers.length; idx++)
	    if (headers[idx].getName().equalsIgnoreCase("Content-type")) break;
	if (idx == headers.length)
	{
	    headers = Util.resizeArray(headers, idx+1);
	    headers[idx] =
		new NVPair("Content-type", "application/x-www-form-urlencoded");
	}
	return Post(file, Codecs.nv2query(form_data), headers);
    }
public HTTPResponse Post ( String file , NVPair form_data [ ] , NVPair headers [ ] ) throws IOException , ModuleException { int idx ; for ( idx = 0 ; idx < headers . length ; idx ++ ) if ( headers [ idx ] . getName ( ) . equalsIgnoreCase ( "Content-type" ) ) break ; if ( idx == headers . length ) { headers = Util . resizeArray ( headers , idx + 1 ) ; headers [ idx ] = new NVPair ( "Content-type" , "application/x-www-form-urlencoded" ) ; } return Post ( file , Codecs . nv2query ( form_data ) , headers ) ; }
POST's form-data to the specified file using the specified headers.
POST ' s form - data to the specified file using the specified headers .