目前,我的表单元素如下所示:
<form enctype="multipart/form-data" name="copyReplaceForm" method="POST" action="/app/applications/copyreplace/postCsv">
但我不想给action
,enctype
和method
,<form>
我想用dojo.xhrPost()
.
有人可以告诉我如何发送使用xhrPost
吗?
此外,我的 REST 代码如下所示:
@POST
@Path("/bulkCopyReplaceFirst")
@Produces(MediaType.TEXT_PLAIN)
@Consumes(MediaType.MULTIPART_FORM_DATA)
我的 xhrPost 如下所示
var result;
dojo.xhrPost({
url :"/CopyReplace/bulkCopyR",
preventCache: true,
contentType : "multipart/form-data",
load: function(response) {
txtResponse = response;
console.log("response is : txtResponse"+txtResponse)
},
error: function(error, ioArgs) {
console.log("postImageOptions() ERROR :: " + error);
console.log("postImageOptions() ioArgs :: " + ioArgs);
return error;
}
});
}