POST / PUT / DELETE Requests
Last updated
Last updated
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 to restore the data to the original state before the test was executed.
POST Example:
The URL in this example is /user/role
authenticate()
authenticates the token
The third piece of information is the payload.
PUT Example:
The URL in this example is /user/mobilenumber
authenticate()
authenticates the token
The third piece of information is the payload.
DELETE Example:
The URL in this example is /courses/1
authenticate()
authenticates the token
The third piece of information is the payload.
Even if there is no data, pass an empty array otherwise the response will be 403 forbidden
.