httpPost()

Method for executing an HTTP POST request. If data type is not specified, it will default to 'text'. This is equivalent to calling httpDo(path, 'POST').

उदाहरण

सिंटैक्स

httpPost(path, [data], [datatype], [callback], [errorCallback])
httpPost(path, data, [callback], [errorCallback])
httpPost(path, [callback], [errorCallback])

पैरामीटर्स

path
String|Request: name of the file or url to load
data
Object|Boolean: param data passed sent with request
datatype
String: "json", "jsonp", "xml", or "text". If omitted, httpPost() will guess.
callback
Function: function to be executed after httpPost() completes, data is passed in as first argument
errorCallback
Function: function to be executed if there is an error, response is passed in as first argument

Returns

Promise: A promise that resolves with the data when the operation completes successfully or rejects with the error after one occurs.

संबंधित संदर्भ