API accepts a JSON payload (Rust)
Generated output
Section titled “Generated output”### ✅ API accepts a JSON payload
- **Given** the client has the following JSON payload **Payload** ```json { "password": "secret", "rememberMe": true } ```- **When** the client sends the request- **Then** the response status should be 200- **And** the response body should include "token"Rust code
Section titled “Rust code”use executable_stories::Story;use serde_json::json;
#[test]fn test_api_accepts_json_payload() { let mut s = Story::new("API accepts a JSON payload"); s.given("the client has the following JSON payload"); s.json("Payload", &json!({ "password": "secret", "rememberMe": true })); s.when("the client sends the request"); s.then("the response status should be 200"); s.then("the response body should include \"token\""); s.pass();}