When Steps
Autokin REST Steps

When I GET {uri}

To perform a simple GET request, we use this When step.
1
Scenario: Getting user information
2
Given that a endpoint is up at mydomain.com
3
Given I set Content-Type header to application/json
4
Given I set DocId header to 3001
5
When I GET /users/info
Copied!

When I POST to {uri}

To submit a POST request, this step will help us.
1
Scenario: Creating a new task
2
Given that a secure endpoint is up at mydomain.com
3
Given I set Content-Type header to application/json
4
Given I set the JSON body to
5
"""
6
`{
7
"name": "New Task",
8
"priority": 1,
9
"notes": "Go document things"
10
}`
11
"""
12
When I POST to /tasks
Copied!

When I PUT to {uri}

With this step we can do a simple PUT
1
Scenario: Creating a new task
2
Given that a secure endpoint is up at mydomain.com
3
Given I set Content-Type header to application/json
4
When I PUT to /tasks
Copied!

When I perform DELETE to {uri}

Performing a DELETE request is simple as using this step
1
Scenario: Delete a task
2
Given that a secure endpoint is up at mydomain.com
3
Given I set Content-Type header to application/json
4
Given I set query parameter taskId to 1001
5
WHEN I perform DELETE to /tasks
Copied!

When I PATCH to {uri}

When you need to use the PATCH method us this step.
1
Scenario: Some patch request
2
Given that a secure endpoint is up at mydomain.com
3
Given I set Content-Type header to application/json
4
WHEN I PATCH to /patch/uri
Copied!
Last modified 8mo ago