按这个案例方法可以
http://grinder.sourceforge.net/g3/script-gallery.html#form.pyclass TestRunner:
def __call__(self):
files = ( NVPair("self", "form.py"), )
parameters = ( NVPair("run number", str(grinder.runNumber)), )
# This is the Jython way of creating an NVPair[] Java array
# with one element.
headers = zeros(1, NVPair)
# Create a multi-part form encoded byte array.
data = Codecs.mpFormDataEncode(parameters, files, headers)
grinder.logger.output("Content type set to %s" % headers[0].value)
# Call the version of POST that takes a byte array.
result = request1.POST("/upload", data, headers)
groovy版本参考post源码,类似