As per the information you provided on the question, i assume that your web api end point accepts the form data and return the new url to which your page should redirect to.
You can use jQuery to hijack the form submit event, send the data using ajax, and once you get the response from your web api call (the new url), use that to set the new value of location.href
property so that browser will issue a new GET request to that.
You have to make sure that you are preventing the normal form submit behavior. You can use the jQuery preventDefault method to do so.
$(function(){
$("[type='submit']").click(function(e){
e.preventDefault();
var _formUrl=$(this).attr("action");
//make the ajax call now.
//Build an object which matches the structure of our view model class
var model = { Name: "Shyju", Id: 123 };
//update the above line with data read from your form.
$.ajax({
type: "POST",
data: JSON.stringify(model),
url: _formUrl,
contentType: "application/json"
}).done(function(res) {
console.log('res', res);
// Do something with the result :)
window.location.href=res;
});
});
});
Also take a look at How to pass json POST data to Web API method as object