encoder function for multipart/form-data in groovy
问题 I need to form a 'multipart/form-data' REST request with jpeg image and JSON file as the content.I am stuck with encoding the 'multipart/form-data' as a zip file. Can someone tell me, how I can achieve this with groovy RESTClient? I could not find any documentation regarding this. 回答1: As it can be seen in the docs RESTClient extends HTTPBuilder . HTTPBuilder has a getEncoder method that can be used to add dedicated encoder (with type and method). See the following piece of code: import org