You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A C# web server for mocking web APIs. One web server records API request and stores the responses in a file. The other web server uses this file to replay responses.
Configuration
{
// The Mocca configuration section"Mocca": {
// The URL of the web API that you want to mock."ForwardTo": "https://localhost:7228",
// The file where you want to store the responses in."ResponseFile": "../responses.txt",
// The request paths that should not be stored in the file. "IgnoredPaths": [
"/swagger**"
],
// The JSON properties you want to overwrite."Overwrite": [
{
// The method that the request should have."RequestMethod": "GET",
// The path pattern that the request should match."RequestPathPattern": "/weatherforecast",
// The JSON property path."PropertyPath": "[4].temperatureC",
// The replacement value."Value": "69"
},
// Add more properties you want to replace.
]
}
}
{ // The Mocca configuration section "Mocca": { // The URL of the web API that you want to mock. "ForwardTo": "https://localhost:7228", // The file where you want to store the responses in. "ResponseFile": "../responses.txt", // The request paths that should not be stored in the file. "IgnoredPaths": [ "/swagger**" ], // The JSON properties you want to overwrite. "Overwrite": [ { // The method that the request should have. "RequestMethod": "GET", // The path pattern that the request should match. "RequestPathPattern": "/weatherforecast", // The JSON property path. "PropertyPath": "[4].temperatureC", // The replacement value. "Value": "69" }, // Add more properties you want to replace. ] } }