public RequestBuilder createFileUploadRequestBuilder(String httpUrl, String methodName, String reqBodyAsString) throws IOException {
        Map<String, Object> fileFieldNameValueMap = getFileFieldNameValue(reqBodyAsString);

        List<String> fileFieldsList = (List<String>) fileFieldNameValueMap.get(FILES_FIELD);

        MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();

        /*
	 * Allow fileFieldsList to be null.
	 * fileFieldsList can be null if multipart/form-data is sent without any files
	 * Refer Issue #168 - Raised and fixed by santhoshTpixler
	 */
        if(fileFieldsList != null) {
        	buildAllFilesToUpload(fileFieldsList, multipartEntityBuilder);
	}

        buildOtherRequestParams(fileFieldNameValueMap, multipartEntityBuilder);

        buildMultiPartBoundary(fileFieldNameValueMap, multipartEntityBuilder);

        return createUploadRequestBuilder(httpUrl, methodName, multipartEntityBuilder);
    }
public RequestBuilder createFileUploadRequestBuilder ( String httpUrl , String methodName , String reqBodyAsString ) throws IOException { Map < String , Object > fileFieldNameValueMap = getFileFieldNameValue ( reqBodyAsString ) ; List < String > fileFieldsList = ( List < String > ) fileFieldNameValueMap . get ( FILES_FIELD ) ; MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder . create ( ) ; if ( fileFieldsList != null ) { buildAllFilesToUpload ( fileFieldsList , multipartEntityBuilder ) ; } buildOtherRequestParams ( fileFieldNameValueMap , multipartEntityBuilder ) ; buildMultiPartBoundary ( fileFieldNameValueMap , multipartEntityBuilder ) ; return createUploadRequestBuilder ( httpUrl , methodName , multipartEntityBuilder ) ; }
This is the http request builder for file uploads, using Apache Http Client. In case you want to build
or prepare the requests differently, you can override this method.

Note-
With file uploads you can send more headers too from the testcase to the server, except "Content-Type" because
this is reserved for "multipart/form-data" which the client sends to server during the file uploads. You can
also send more request-params and "boundary" from the test cases if needed. The boundary defaults to an unique
string of local-date-time-stamp if not provided in the request.

You can override this method via @UseHttpClient(YourCustomHttpClient.class)

@param httpUrl
@param methodName
@param reqBodyAsString
@return
@throws IOException