HTTP API 测试框架 dogpatch

码农软件 · 软件分类 · 测试工具 · 2019-11-22 18:41:27

软件介绍

dogpatch 是一个用 PHP 和 curl 开发的 HTTP API 测试框架。支持 SSL、基本认证、自定义请求头、重定向和大多数 HTTP 方法。

示例代码:

$dogpatch = new Dogpatch();

$dogpatch->get("https://api.github.com")
         ->assertStatusCode(200)
         ->assertHeadersExist(array(
            "X-GitHub-Request-Id",
            "ETag"
         ))
         ->assertHeaders(array(
            "Server" => "GitHub.com"
         ))
         ->assertBody(IS_VALID_JSON)
         ->close();

$dogpatch->get("https://freegeoip.net/json/8.8.8.8")
         ->assertStatusCode(200)
         ->assertHeadersExist(array(
            "Content-Length"
         ))
         ->assertHeaders(array(
            "Access-Control-Allow-Origin" => "*"
         ))
         ->assertBodyJsonFile(dirname(__DIR__) . "/examples/json/freegeoip.net.json")
         ->close();

本文地址:https://codercto.com/soft/d/19567.html

Hello World

Hello World

Hannah Fry / W. W. Norton Company / 2018-9 / GBP 17.99

A look inside the algorithms that are shaping our lives and the dilemmas they bring with them. If you were accused of a crime, who would you rather decide your sentence—a mathematically consistent ......一起来看看 《Hello World》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具