The post function is established to call a restAPI with post method.
Its return is a JSON object.
var params={"nm":"customer name 1"};
var ret = rest.post("http://localhost:8080/restSample/efwRestAPI/customer/u001",params);
// {"id":"u001","nm":"customer name 1"}
Calling | Returning |
rest . post ( apiUrl , params ) | null or JSON |
rest . post ( apiUrl , params , heads ) | null or JSON |
Parameters | Type | Description |
apiUrl | String | The url for the called rest api. |
params | JSON Object | To send values to the rest api. |
heads | JSON Object | The additional request heads. |