net_bazzline/http_request_mock_server
Composer 安装命令:
composer create-project net_bazzline/http_request_mock_server
包简介
free as in freedom application to test http requests with configurable responses that supports the formats json, raw and xml
关键字:
README 文档
README
This component should easy up your testing. It can also be used as a mocked endpoint.
The current change log can be found here.
The latest stable release is
Benefits
- dead stupid simple (With Great Power Comes Great Responsibility)
- extendable by its Open/closed principle inside the HttpRequestmockServerFactory
- fast and easy to use
- shipped with a ready to use index.php
- zero dependencies
- zero configuration, the usage is just a wget away
Supported GET parameters
content
Url encoded string.
format
One of the following three:
- json
- raw
- xml
status_code
Any number is working.
Example
Returning JSON
Url with all available and supported get parameters
?format=json&content=%7B%22foo%22%3A+%22bar%22%7D
will return
{"foo":"bar"}
Returning RAW
Url with all available and supported get parameters
?format=raw&content=There+is+no+foo+without+a+bar
will return
There is no foo without a bar
Returning XML
Url with all available and supported get parameters
?format=xml&content=<foo>bar<%2Ffoo>
will return
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <xml> <foo>bar</foo> </xml>
Mature Projects
This project has a small number of source lines of code (less than 127 lines of code without the syntactic sugar). It is just a small thing you can use. There are a lot of mature projects out there like http-server-mock to name just one.
Final Words
Star it if you like it :-). Add issues if you need it. Pull patches if you enjoy it. Write a blog entry if you use it. Donate something if you love it :-].
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2017-08-31