Welcome to Teapot API Mock: Satisfying Your Mocking Needs! โ (HTTP Status Code: 418)
Are you tired of the headaches caused by external API dependencies when conducting end-to-end tests? Look no further โ Teapot API Mock is here to the rescue! Our project aims to address the common challenge of relying on external APIs during testing by providing a simple yet powerful mocking tool. With Teapot API Mock, you have the ability to simulate API responses exactly as you desire.
Key Features
๐ Setting Response Body for POST Calls:
Tailor the response body of your POST requests to mimic your desired API behavior.
๐ Responding with Headers:
Control the headers that will be sent back in the response, just as you need them.
๐ฅ Custom HTTP Status Codes:
Set the HTTP status code you want to receive as a response to your requests.
๐ทโโ๏ธ How It Works:
'Set' Your Request
Send a request to the mock API, specifying the 'Action' header as 'set.'
The mock API will record the headers, status code (default is 200), request body, HTTP method, and the full URL path.
This information will be stored in memory and sent back when requested. Ensure that the full URL path, including query string parameters and their values, matches when requesting. The HTTP method and the full path are used to identify the request.
A successful 'set' request will result in a response of 'Mock endpoint set' with an HTTP status code of 200.
Get Your Response
Make the same call again, but this time without the 'set' header (Action: set).
The mock API will look for the request you made and return the response you set, along with the headers you sent in the request and the specified HTTP status code.
The original 'Action' and 'Action_HttpResponseCode' headers will be removed from the response, and the body of your call will be ignored along with any additional headers you sent.
curl --location POST 'https://mock.teapotapimock.com/resource1/value/bla?p=2&next=one' \ --header 'Action: set' \ --header 'Action_HttpResponseCode: 424' \ --header 'RandomHeaderIWantReturned: RandomValue' \ --header 'Content-Type: application/json' \ --data '{ "somebody": "out there?", "yes": 1 }'
curl --location 'https://mock.teapotapimock.com/resource1/value/bla?p=2&next=one' \ --header 'Content-Type: text/plain' \ --data 'The body will not be checked. Just the URL and HTTP method.'
๐งน Keep it Clean
Please note that we will not be held responsible for any leakage of sensitive information. Teapot API Mock is intended for testing and development purposes only. Do not use this service with production data or settings. From a security standpoint, avoid sending sensitive information, such as passwords, secrets, or tokens. If sensitive data is sent, consider using the 'Action: delete' header to remove it as a final step.
๐ Create a Mock Domain
Want to generate a unique URL for testing purposes? Teapot API Mock has you covered. Create a mock domain to streamline your testing environment.
Teapot API Mock is your trusted partner in mock API management. Enjoy the power to simulate the responses you need, and streamline your testing and development processes with confidence. Cheers to hassle-free testing! โ๐