Skip to content
Nate Hansen edited this page Jun 7, 2018 · 2 revisions

The main function for the Request Tester is to allow for trivial mocking of web-services by using the file system as a basic emulation of responses

I MUST STRESS THIS APPLICATION IS FOR TESTING/DIAGNOSTIC PURPOSES ONLY IT HAS NO SECURITY IMPLEMENTATION DO NOT USE THIS FOR PRODUCTION.

The main workflow is to start the requestTester it will serve any files specified in the path of the HTTP request. (this is a direct port of path, meaning you can use sub-directories ectra)

For every incoming request the application will create a .request file this file can be inspected by a text editor to read the request details.

For a file to be successfully used as a response it must contain header information. Usually you will want this to be HTTP/1.1 200 This simply says this is a http/1.1 server and the response was 200 ok. Then there must be a empty newline between any additional headers and the content for example

HTTP/1.1 200
Content-Type: text/plain
Content-Length: 11

Hello World

This would print Hello World if the request came in to a web-browser.