HttPlaceholder - Quickly stub away any HTTP service

HttPlaceholder

HttPlaceholder lets you stub away any HTTP webservice. HttPlaceholder:

Getting started

Let's take a look at a short demo.

1. Install HttPlaceholder

See Download.

2. Create a stub

Create a new .yaml file (e.g. stub.yaml).
Copy and paste these contents in your new file:

- id: situation-01
  conditions:
    method: GET
    url:
      path:
        equals: /users
      query:
        id:
          equals: 12
        filter:
          equals: first_name
  response:
    statusCode: 200
    json: |
      {
        "first_name": "John"
      }

3. Start HttPlaceholder

Open the terminal in the folder you've added the stub.yaml file and run the following command: httplaceholder. HttPlaceholder will now start and will load the stubs in the current folder.

HttPlaceholder running in terminal

4. Perform a call to HttPlaceholder

Perform a specific HTTP call to HttPlaceholder so your provided response will be returned.

curl "http://localhost:5000/users?id=12&filter=first_name" -D-
cURL call result
wget -qSO - "http://localhost:5000/users?id=12&filter=first_name"
wget call result
iwr "http://localhost:5000/users?id=12&filter=first_name"
PowerShell call result
http "localhost:5000/users?id=12&filter=first_name"
PowerShell call result

5. View the requests

You can view and inspect the performed requests in the user interface at http://localhost:5000/ph-ui.

6. Learn more

For more sophisticated examples, go to the samples to view samples for all supported HTTP condition checkers and response writers. Learn more about HttPlaceholder by reading the documentation.