Skip to content

aognio/httpmock.php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

httpmock.php

Quick and dirty HTTP response mocker based on plain text files written in PHP.

Installation

  1. Copy mockhttp.php to any PHP-enabled web server folder
  2. Set up URL rewriting. Example .htaccess file for Apache is included.
  3. Crear .txt files in the same folder or in subfolders and you're good to go

Usage

If your mock file is at project1/mock1.txt you should access it as:

http://yourserver.com/project1/mock1

If you're using a subfolder instead of the document root for serving your mocks:

http://yourserver.com/path/to/subfolder/project1/mock1

Testing with cURL

Here is a CLI example using cURL:

$ curl -vv http://yourserver.com/project1/mock1

(c) Antonio Ognio [email protected]

About

Quick and dirty HTTP response mocker based on plain text files written in PHP.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages