POST / PUT / DELETE Requests
POST / PUT / DELETE Requests
When calling a POST / PUT / DELETE method, three pieces of information are required:
The URL (This could also contain the query parameters)
The authentication token
The payload
POST, PUT and DELETE requests modify the original seed data that might affect other tests. Use annotations to restore the data to the original state before the test was executed.
These requirements also apply to PATCH requests.
POST Example:
The URL in this example is
/user/role
authenticate()
authenticates the tokenThe third piece of information is the payload.
PUT Example:
The URL in this example is
/user/mobilenumber
authenticate()
authenticates the tokenThe third piece of information is the payload.
DELETE Example:
The URL in this example is
/courses/1
authenticate()
authenticates the tokenThe third piece of information is the payload.
Even if there is no data, pass an empty array otherwise the response will be 403 forbidden
.
Last updated