Skip to content

Commit

Permalink
docs(post): add documentation about posting data
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Benitte committed Jun 28, 2017
1 parent 0adbd66 commit fe2625e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,31 @@ Scenario: Using GitHub API
Then I should receive a 200 HTTP status code
```

#### Posting data

You can easily issue a POST request using json payload

```gherkin
Scenario: Creating a resource using json payload
Given I set request json body
| username | plouc |
| gender | male |
When I POST https://my-api.io/users
Then I should receive a 201 HTTP status code
```

You can also use form encoded values, all you have to do is
to change `json` for `form`

```gherkin
Scenario: Creating a resource using json payload
Given I set request form body
| username | plouc |
| gender | male |
When I POST https://my-api.io/users
Then I should receive a 201 HTTP status code
```

#### Using values issued by a previous request

Imagine you want to test a resource creation and then that you're able
Expand Down

0 comments on commit fe2625e

Please sign in to comment.