handbook/references/behat-steps/given-that-http-requests-to-will-respond-with.md
Pascal Birchler 264cb131bf
Fix handbook information architecture
- Organize files in folders according to the desired structure
- Use directory iterator to loop through all files and folders (makes generation more robust)
2025-06-25 15:38:39 +02:00

5.8 KiB

Given /^that HTTP requests to (.*?) will respond with:$/

Mock HTTP requests to a given URL.


Usage

Scenario: My example scenario
  Given that HTTP requests to https://api.github.com/repos/wp-cli/wp-cli/releases?per_page=100 will respond with:
    """
    HTTP/1.1 200
    Content-Type: application/json

    { "foo": "bar" }
    """

Behat steps documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.