LogoLogo
  • Hello Autokin
  • Get started
  • Your First Autokin Test
  • Features
    • Tags
    • Chaining
    • JSON Schema Comparison
    • Variables
    • Autokin Generators
  • Autokin REST
    • Given Steps
    • When Steps
    • Then Steps
  • Autokin Web
    • Given Steps
    • When Steps
    • Then Steps
    • Supported Emulated Devices
  • Autokin Mobile
    • Give Steps
    • When Steps
    • Then Steps
  • Development Tools
    • VS Code Extension
  • Resources
    • Autokin Github
    • Contributors
    • Frequently Asked Questions
Powered by GitBook
On this page
  • When I GET {uri}
  • When I POST to {uri}
  • When I PUT to {uri}
  • When I perform DELETE to {uri}
  • When I PATCH to {uri}

Was this helpful?

  1. Autokin REST

When Steps

Autokin REST Steps

When I GET {uri}

To perform a simple GET request, we use this When step.

Scenario: Getting user information 
    Given that a endpoint is up at mydomain.com
    Given I set Content-Type header to application/json
    Given I set DocId header to 3001
    When I GET /users/info

When I POST to {uri}

To submit a POST request, this step will help us.

Scenario: Creating a new task 
    Given that a secure endpoint is up at mydomain.com
    Given I set Content-Type header to application/json
    Given I set the JSON body to 
    """
    `{
        "name": "New Task",
        "priority": 1,
        "notes": "Go document things"
    }`
    """
    When I POST to /tasks

When I PUT to {uri}

With this step we can do a simple PUT

Scenario: Creating a new task 
    Given that a secure endpoint is up at mydomain.com
    Given I set Content-Type header to application/json
    When I PUT to /tasks

When I perform DELETE to {uri}

Performing a DELETE request is simple as using this step

Scenario: Delete a task 
    Given that a secure endpoint is up at mydomain.com
    Given I set Content-Type header to application/json
    Given I set query parameter taskId to 1001
    WHEN I perform DELETE to /tasks

When I PATCH to {uri}

When you need to use the PATCH method us this step.

Scenario: Some patch request 
    Given that a secure endpoint is up at mydomain.com
    Given I set Content-Type header to application/json
    WHEN I PATCH to /patch/uri
PreviousGiven StepsNextThen Steps

Last updated 4 years ago

Was this helpful?