/** * Determine whether to send a file as the entire body of an * entity enclosing request such as POST, PUT or PATCH. * * Invokes {@link HTTPSamplerBase#getSendFileAsPostBody()} * * @return flag whether to send a file as POST, PUT or PATCH */ protected boolean getSendFileAsPostBody() { return testElement.getSendFileAsPostBody(); }
/** * Determine if we should use multipart/form-data or * application/x-www-form-urlencoded for the post * * @return true if multipart/form-data should be used and method is POST */ public boolean getUseMultipartForPost() { // We use multipart if we have been told so, or files are present // and the files should not be send as the post body HTTPFileArg[] files = getHTTPFiles(); return HTTPConstants.POST.equals(getMethod()) && (getDoMultipart() || (files.length > 0 && hasNoMissingFile(files) && !getSendFileAsPostBody())); }
/** * Determine if we should use multipart/form-data or * application/x-www-form-urlencoded for the post * * @return true if multipart/form-data should be used and method is POST */ public boolean getUseMultipart() { // We use multipart if we have been told so, or files are present // and the files should not be send as the post body HTTPFileArg[] files = getHTTPFiles(); return getDoMultipart() || (files.length>0 && hasNoMissingFile(files) && !getSendFileAsPostBody()); }
if(sampler.getArguments() != null && !sampler.hasArguments() && sampler.getSendFileAsPostBody()) { OutputStream out = connection.getOutputStream();
if(sampler.getArguments() != null && sampler.getArguments().getArgumentCount() == 0 && sampler.getSendFileAsPostBody()) {
if(sampler.getArguments() != null && sampler.getArguments().getArgumentCount() == 0 && sampler.getSendFileAsPostBody()) {