post

sends a POST request to the server

promise post(string url,object data,object config);

Parameters

urlstringthe URL the request is sent to
dataobjectoptional, the data sent to the server by the POST-request
configobjectthe configuration object of the request

Returns

promise"promise" of the data object

Example

dhx.ajax.post(url, {name: "foo", title: "bar"}).then(function (data) {
    console.log(data);
}).catch(function (err) {
    console.log(err);
});

Related samples

Details

The config object can contain following options:

  • responseType - the type of data that you are expecting back from the server. The available types are:
    • text - returns the plain text as a string
    • xml - returns the result parsed as XML
    • json - returns the result as JSON
  • headers - (object) optional, the headers of the request
Back to top