Currently, my form element looks like below:
<form enctype="multipart/form-data" name="copyReplaceForm" method="POST" action="/app/applications/copyreplace/postCsv">
But instead of giving the action
, enctype
and method
on the <form>
, I want to send it using dojo.xhrPost()
.
Could someone please tell me how to send using xhrPost
?
Also, my REST code piece looks like below:
@POST
@Path("/bulkCopyReplaceFirst")
@Produces(MediaType.TEXT_PLAIN)
@Consumes(MediaType.MULTIPART_FORM_DATA)
My xhrPost looks like below
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;
}
});
}