Skip to content

Latest commit

 

History

History
17 lines (15 loc) · 1.43 KB

specification.md

File metadata and controls

17 lines (15 loc) · 1.43 KB

Specification

httpmockie creates endpoints based on JSON specifications comforming to JSON schema. Each endpoint specification is placed into separate file (single file can contain only single JSON specification).

single JSON endpoint specification must contain fields:

  • path = HTTP path to expose the HTTP endpoint on

additionally the endpoint can be further configured using these fields:

  • status = default is HTTP status OK (200)
  • body = HTTP response body in text format (note that only one of the body, jsonBody, base64Body can be used in a single endpoint JSON specification)
  • jsonBody = HTTP response body in JSON format (note that only one of the body, jsonBody, base64Body can be used in a single endpoint JSON specification)
  • base64Body = HTTP response body encoded in Base64 (useful for returning arbitrary non-textual data, note that only one of the body, jsonBody, base64Body can be used in a single endpoint JSON specification)
  • headers = HTTP headers of response
  • delay = configures delay between responding to client request (useful for setting up advanced scenarios)
    • durationMs = static delay in milliseconds
    • deviationMs = when used together with durationMs it creates non-static delay before responding to client request, the client receives answer after delay in interval [durationMs-deviationMs,durationMs+deviationMs]