The HTTP methods provide the operations, such as create, read, update, and delete that you can perform on IBM® BPM artifacts.
| HTTP method | Description |
|---|---|
| POST | Creates a new resource. |
| GET | Retrieves a resource. |
| PUT | Updates an existing resource. |
| DELETE | Deletes a resource. |
The GET method is a safe method because the state of the resource remains unchanged by this operation.
// Assuming that "dateFromREST" is a java.util.Date object
DateFormat df = DateFormat.getDateTimeInstance();
TimeZone tz = TimeZone.getDefault();
df.setTimeZone(tz);
String formattedDate = df.format(dateFromREST);
// formattedDate has the date you want to show to the user.
When using HTTP methods, consider the following security aspects:
POST /rest/bpm/htm/v1/task?...&x-method-override=PUT
<properties>
<common>
<enable-javascript-execution>true</enable-javascript-execution>
</common>
</properties>
PUT http://host1.company.com:9080/rest/bpm/wle/v1/task/3?action=finish¶ms={"orderNumber":"5","customerName":{"firstName":"John","lastName":"Doe"}}
Headers:
Accept application/json
The following HTTP request shows
how to call the same API using the application/x-www-form-urlencoded content
type:POST http://host1.company.com:9080/rest/bpm/wle/v1/task/3
Headers
Accept application/json
Content-Type: application/x-www-form-urlencoded
X-Method-Override: PUT
Request Body:
action=finish¶ms={"orderNumber":"5","customerName":{"firstName":"John","lastName":"Doe"}}