Starting a service creates a public available HTTP service that simulates an API. Click on “Add” in the Dashboard to start a new service.
You can select a simulation from the dropdown which will be imported when the service starts, and you need to add a label to identify your service from the Dashboard later on.
Click “OK”, and your service should be up and running within a few seconds.
You can enable proxying when starting a new service. Proxying allows the service to forward requests to a remote destination. You specify the base URL of the remote destination in the
Target URL field. You can select one of the following proxy modes:
Simulate: simulate API response based on simulation
Spy: similar to simulate, but call the real service if a request is not matched
Capture: requests will go to the real service and all the interactions will be captured.
Passthrough: bypass Hoverfly service, and get response from the real service. This lets you switch from using virtual service to real service without restarting your app with different configurations.
A Hoverfly Behavior is a function that intercepts and modifies the API response before it returns to the client. With Behaviors, it is possible to introduce bad responses, latency model and more to mimic real world behavior of an API which is otherwise hard to reproduce.
Currently Hoverfly Cloud supports these predefined Behaviors:
Random status code
Find and replace
Set response headers
You can add a Behavior in the "Add service" dialog.
Click on the toggle next to the Behavior name, for example “Random status code”, select status code you want it to return, and use the slider to change the probability of this status code.
You can add additional entries. Probabilities that total over one will get sampled down. When the probability total is less than one, the left over probability is used for the original status code.