title: "给定 /^向 (.*?) 的 HTTP 请求将响应:$/" post_status: publish comment_status: open taxonomy: category: - wp-cli-handbook post_tag: - Behat Steps - Repos - Data


给定 /^向 (.*?) 的 HTTP 请求将响应:$/

模拟向指定 URL 的 HTTP 请求。


用法

场景:我的示例场景
  给定向 https://api.github.com/repos/wp-cli/wp-cli/releases?per_page=100 的 HTTP 请求将响应:
    """
    HTTP/1.1 200
    Content-Type: application/json

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

Behat 步骤文档在每次发布时从 WP-CLI 代码库生成。如需改进建议,请提交拉取请求。


相关