HttPlaceholder lets you stub away any HTTP webservice. HttPlaceholder:
Let's take a look at a short demo.
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"
}
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.
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-
wget -qSO - "http://localhost:5000/users?id=12&filter=first_name"
iwr "http://localhost:5000/users?id=12&filter=first_name"
http "localhost:5000/users?id=12&filter=first_name"
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.